|
|
вернуться в форумNot working and WA #1; what's wrong here? #include<stdio.h> #include <string.h> // n is not required at all, i am leaving it. int main(){ int n, ce, cm, cl, max = 0; char c; scanf ("%d", &n); while ((c = getchar())!= EOF){ if (c == 'E') ce++; else if (c == 'M') cm++; else if (c == 'L') cl++; } /* Emperor Penguin Macaroni Penguin Little Penguin */ max = (ce > cm) ? ((ce > cl) ? ce : cl) : ((cm > cl) ? cm : cl); if (max == ce) printf("Emperor Penguin"); else if (max == cm) printf ("Macaroni Penguin"); else printf ("Little Penguin"); return 0; } |
|
|