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