fork(2) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. char a[21];
  6. scanf("%s",a);
  7. int t,j=0,i=0;
  8. int n = strlen(a);
  9. for(j=1;j < n; j++){
  10. for(i=0;i<j;i++) {
  11. if (a[i] > a[j]) break;
  12. }
  13. int t=a[j];
  14. int t1;
  15. for(;i<=j;i++){
  16. t1=a[i];
  17. a[i]=t;
  18. t=t1;
  19. }
  20. }
  21. printf("%s",a);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 4396KB
stdin
H2e3L*Lo,Wor#Ld
stdout
#*,23HLLLWdeoor