首页 > 试题广场 >

判断字母

[编程题]判断字母
  • 热度指数:52459 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 256M,其他语言512M
  • 算法知识视频讲解
从键盘任意输入一个字符,编程判断是否是字母(包括大小写)。

输入描述:
输入包括一个字符。


输出描述:
输出该字符是字母(YES)或不是(NO)。
示例1

输入

H

输出

YES
示例2

输入

9

输出

NO
while True:
    try:
        n=input()
        if n.isalpha():
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

发表于 2021-05-31 11:32:06 回复(0)
while True:
    try:
        word = input()
        if word.isalpha():
            print("YES")
        else:
            print("NO")
    except:break
发表于 2021-02-26 14:52:07 回复(0)
while True:
    try:
        a = input()
        if a.isalpha():
            print("YES")
        else:
            print("NO")
    except:
        break

发表于 2020-11-24 13:32:12 回复(0)
while True:
    try:
        print("YES") if input("").isalpha() else print("NO");
    except:
        break;
发表于 2020-11-08 11:24:32 回复(0)
while True:
    try:
        ch=input()
        if ch.islower()&nbs***bsp;ch.isupper():
            print('YES')
        else:
            print('NO')
    except:
        break

发表于 2020-09-18 18:52:54 回复(0)
while True:
    try:
        str = input()
        if str.isalpha():
            print('YES')
        else:
            print('NO')
    except:
        break

xixi
发表于 2020-04-09 05:34:36 回复(0)