Advertisement
Guest User

Untitled

a guest
Oct 13th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. int main(int argc, char* argv[])
  2. {
  3. {
  4. int i,ch,j;
  5. int max,max_i;
  6. unsigned char Counter[256];
  7. int d = My_atoi(argv[1]);
  8.  
  9.  
  10. for(i=0; i<256; i++){
  11. Counter[i] = 0;
  12. }
  13.  
  14.  
  15. while (((ch = fgetc(stdin)) && ch != EOF )){
  16. Counter[ch]++;
  17. }
  18.  
  19. while(d--){
  20. max=0;
  21. for(i=0; i<256; i++){
  22. if(Counter[i] > max)
  23. max=Counter[i];
  24. max_i=i;
  25. }
  26. for(i=0; i<256; i++){
  27. if(isprint(i) && Counter[i] ){
  28. printf("%d '%c' : %d\n",i,i,max);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement