Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int iACounter;
- int iBCounter;
- int iCCounter;
- int main () {
- iACounter = 0;
- iBCounter = 0;
- iCCounter = 0;
- while (1) {
- for (int i = 0; i < 100; i++) {
- //standardeingabe lesen
- char c = getchar();
- switch (c) {
- case 'A':
- iACounter++;
- break;
- case 'B':
- iBCounter++;
- break;
- case 'C':
- iCCounter++;
- break;
- }
- }
- printf("Es wurden %d A's, %d B's und %d C's ausgegeben",
- iACounter, iBCounter, iCCounter);
- iACounter = iBCounter = iCCounter = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement