#include<stdio.h> |
int main() { |
printf ( "请任意输入一个字母:" ); |
char c; |
c = getchar (); |
if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122)) |
if (c >= 65 && c <= 90) { |
c = c + 32; |
printf ( "该大写字母的小写形式为:%c" , c); |
} |
else { |
c = c - 32; |
printf ( "该小写字母的大写形式为:%c" , c); |
} |
else |
printf ( "请重新输入!" ); |
return 0; |
} |