fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int main()
  5. {
  6. int ascii[26] = { 0 };
  7. char msg[32767];
  8.  
  9. printf("Enter message: ");
  10. gets(msg);
  11.  
  12. for (char* p = msg; *p; ++p)
  13. if (isalpha(*p))
  14. ++ascii[tolower(*p) - 'a'];
  15.  
  16. for (int i = 0; i < 26; ++i)
  17. for (int c = 0; c < ascii[i]; ++c)
  18. putchar(i + 'a');
  19. }
Success #stdin #stdout 0s 2172KB
stdin
Wow! Whenever you go outside, it is actually a very pretty world.
stdout
Enter message: aaacddeeeeeeghiiilllnoooooprrrrsstttttuuuvvwwwwyyyy