#include
main()
{
char a;
printf("\n 请输入一个字符" )
scanf("%c",&a)
if(a>='A'&&a<='Z') /判断是否是大写字母\
printf("\n 你输入的字符是小写",a)
else
printf("\n 你输入的字符不是小写",a)
}
#include
#include
int main()
{
char a;
printf("please enter the ABC:");
scanf("%c",&a);
if(a>='A'&&a<='Z')
printf("%c",a);
else
printf("%c",a-32);
system("pause");
}
这样就可以了,a的ASCII 码比A的大32,知道这些就够了,呵呵
太太太太简单了;
输入部分,查找ASCII码,比较是否在大写的数值范围;
是小写就加差值输出。
我是忘了怎么写了,好长时间不用。
楼上的更简单。
char c;
if(c>='A'&&c<='Z')
就可以了 后面输出时 在强转下
判断ASCII
if(t>=65&&t<=97)
printf("%c",t)
else
{
t=t-32
printf("%c",t)
}