#include<stdio.h>int main(){ char c;scanf("%c",&c);if(c>="a" && c<="z")c+="A"-"a"printf("%c\n",c)return 0;}int main() { char c; printf("輸入一個字母:"); scanf("%c", &c); if("a"<=c && c<="z") { c += 32; printf("大寫字母是:%c", c); } else if("A"<=c && c<="Z") { printf("你輸入的已經是大寫字母了:%c", c); } else { printf("你輸入的不是字母!\n"); } return 0;}
#include<stdio.h>int main(){ char c;scanf("%c",&c);if(c>="a" && c<="z")c+="A"-"a"printf("%c\n",c)return 0;}int main() { char c; printf("輸入一個字母:"); scanf("%c", &c); if("a"<=c && c<="z") { c += 32; printf("大寫字母是:%c", c); } else if("A"<=c && c<="Z") { printf("你輸入的已經是大寫字母了:%c", c); } else { printf("你輸入的不是字母!\n"); } return 0;}