Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main()
  6. {
  7. int ch;
  8. int klein = 0;
  9. int gross = 0;
  10. int sonder = 0;
  11.  
  12.  
  13.  
  14. ch = fgetc(stdin);
  15.  
  16. fputc(ch, stdout);
  17.  
  18. while( ch != EOF)
  19. {
  20. //fputc(ch, stdout);
  21. if(ch >= 'a' && ch <= 'z')
  22. klein++;
  23.  
  24. else if(ch >= 'A' && ch <= 'Z')
  25. gross++;
  26.  
  27. else
  28. sonder++;
  29.  
  30.  
  31.  
  32. ch = fgetc(stdin);
  33. }
  34.  
  35. int ges = klein + gross + sonder;
  36.  
  37. printf("\n");
  38. printf("Klein: %i\n", klein);
  39. printf("Gross: %i\n", gross);
  40. printf("Sonder: %i\n", sonder);
  41. printf("Gesamt: %8i\n", ges);
  42. system("pause");
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement