问题:
给定一个字符串S,查找最大的字母字符,其大写和小写均显示在S中。应返回大写字符。例如,对于S=“admeDCAB”,返回“D”。如果没有此类字符,请返回“否”
s=input()
l=[0]*26
u=[0]*26
ln=len(s)
for i in range(ln):
if(s[i].islower()):
l[int(ord(s[i])-ord(('a')))]=1
else:
u[int(ord(s[i])-ord(('A')))]=1
for i in range(25,-1,-1):
if(l[i]==1 and u[i]==1):
print(chr(i+ord('A')))
print(NO)
打印完成后如何退出(chr(i+ord('A'))打印
要回答你的实际问题
以一种类似Python的方式
相关问题 更多 >
编程相关推荐