判断大小写字母

判断大小写字母(Judge the uppercase or lowercaset)


描述
给定一个字母,要求判断该字符是大写的还是小写的,如果为大写,则输出Y,否则为N。
Input a letter, judge it is uppercase or lowercase, if it is uppercase, output Y, otherwise N.
 


输入
一个字母
a letter
 

输出
Y或者N,最后输出一回车
if it is uppercase, output Y, otherwise N.
 

输入样例
a
 

输出样例
N
 
来源







#include
//主函数
int main()
{
    char a;
    scanf("%c",&a);
    
    //判断ASC码值
    if(a>=97 && a<=122)
        printf("N");
    if(a>=65 && a<=90)
        printf("Y");

    //输出回车
    printf("\n");
}


你可能感兴趣的:(c语言)