题解 | #竞选社长#
竞选社长
http://www.nowcoder.com/practice/45a30e3ef51040ed8a7674984d6d1553
BC147 竞选社长
思路:
step1:计数比较;
代码如下:
n = input()
a = n.count('A')
b = n.count('B')
if a > b:
print('A')
elif a < b:
print('B')
else:
print('E')
竞选社长
http://www.nowcoder.com/practice/45a30e3ef51040ed8a7674984d6d1553
n = input()
a = n.count('A')
b = n.count('B')
if a > b:
print('A')
elif a < b:
print('B')
else:
print('E')
相关推荐