Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(){
  5.  
  6. int c,i, nwhite, nother;
  7. int ntab[10];
  8. nwhite= nother = 0;
  9. for (i = 0; i<10; ++i)
  10. ntab[i]= 0;
  11. while ((c = getchar()) != EOF)
  12. if(c>='0' && c<='9')
  13. ++ntab[c-'0'];
  14. else if (c== ' ' || c=='\n' || c=='\t')
  15. ++nwhite;
  16. else
  17. ++nother;
  18. printf("cyferki =");
  19. for (i =0; i<10;++i)
  20. printf("%d", ntab[i]);
  21. printf(", biale znaki =%d, inne = %d\n", nwhite, nother);
  22.  
  23.  
  24.  
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement