fork(1) download
  1. #include<string.h>
  2. #include<stdio.h>
  3. int main(){
  4. char str[100],n;
  5. scanf("%s",str);
  6. int i;
  7. int buf[256]={0};
  8. n=strlen(str);
  9. for( i=0;i<n;i++) buf[(int)str[i]]++;
  10. for( i=0;i<n;i++) while(buf[(int)str[i]]-- >0)printf("%c",str[i]);
  11. return 0;
  12. }
  13.  
stdin
kapilrajadurga
compilation info
prog.c: In function ‘main’:
prog.c:8: warning: implicit declaration of function ‘strlen’
prog.c:8: warning: incompatible implicit declaration of built-in function ‘strlen’
prog.c:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
stdout
kaaaapilrrjdug