#include <stdio.h>
int main()
{
char ch ;
printf("press a key and then press enter:");
ch = getchar();
ch =ch +32;
printf("%c,%d\n",ch,ch);
return 0;
}
知识点:大写字母转化为小写字母,定义为字符型,大小写字母相差32,转化时加上32即可得到转化的字母。
心得体会:知道字符型定义为char,大小写相差32,输出时字符型为%c。