def hsf(c):
    return ord(c) - ord('a')


word = input()
table = [0] * 26
for c in word:
    table[hsf(c)] += 1
max_num = max(table)
for i in range(26):
    if table[i] == max_num:
        print(chr(i + ord('a')), max_num, sep='\n')
        break

代码在P1525 - [蓝桥杯2020初赛] 单词分析 - New Online Judge (ecustacm.cn)可以ac 但是在这里直接报错RR image

0 条评论

目前还没有评论...

信息

ID
8
时间
1000ms
内存
256MiB
难度
6
标签
(无)
递交数
41
已通过
13
上传者