我这个是小写转大写,大写转小写,都是通过ascll码来进行转换,你理解理解
char c; scanf("%c",&c); if(c>='a'&&c<='z') c-=32; else if(c>='A'&&c<='Z') c+=32; printf("%c\n",c);
输入字母-32