fork download
  1. // 使用方法
  2. // a.exe < input.txt
  3.  
  4. #include <stdio.h>
  5.  
  6. int main()
  7. {
  8. int count[256] = {0}, i,j;
  9. char c;
  10.  
  11. while ((c = getchar()) != EOF) {
  12. if (c >= 'a' && c <= 'z') {
  13. count[c - '\0']++;
  14. }
  15.  
  16. }
  17. for ( i = 0; i < 256; ++i) {
  18. if (count[i]) {
  19. printf("%c : ", '\0' + i);
  20. for ( j = count[i]; j--;) {
  21. putchar('*');
  22. }
  23. putchar('\n');
  24. }
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
Standard output is empty