编写一个程序,可以一直接收键盘字符,
如果是小写字符就输出对应的大写字符,
如果接收的是大写字符,就输出对应的小写字符,
如果是数字不输出。
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main(){
while (1){
char a;
a = _getch();
if (65 <= a && a <= 90){
a = a + 32;
printf("%c",a);
}
else if (97 <= a && a <= 122){
a = a - 32;
printf("%c", a);
}
else if (48 <= a && a <= 57){
printf("");
}
else{
printf("\n输入错误\n");
break;
}
}
system("pause");
return 0;
}