Guest User

Untitled

a guest
Oct 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. int main()
  2. {
  3. int *s;
  4. int i;
  5. char *buf = malloc(40000);
  6.  
  7. s = malloc(130);
  8. read(0, buf, 39990);
  9. for (i = 0; i < 26; ++i)
  10. s[i] = 0;
  11. for(i = 0; buf[i]; ++i)
  12. {
  13. if (buf[i] > 96 || buf[i] < 123)
  14. ++s[buf[i] - 97];
  15. }
  16. for (i = 0; i < 26; ++i)
  17. printf("%c : >> %d\n", i + 97, s[i]);
  18. }
Add Comment
Please, Sign In to add comment