题解 | #竞选社长#
竞选社长
https://www.nowcoder.com/practice/45a30e3ef51040ed8a7674984d6d1553
#include <stdio.h> int main() { char ch; int a=0,b=0; while((ch=getchar())!='0') { if(ch=='A') { a++; } else if(ch=='B') { b++; } } if(a>b) printf("A"); else if(b>a) printf("B"); else printf("E"); return 0; }