实现程序可以一直接收键盘字符,如果是小写字符就输出对应的大写字符,如果接收的是大写字符,就输出对应的小写字符,如果是数字不输出.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int tmp = 0;
while((tmp = getchar()) != EOF)
{
if(tmp >= 48 && tmp <= 57)
continue;
else if(tmp >= 65 && tmp <= 90)
tmp += 32;
else if(tmp >= 97 && tmp <= 122)
tmp -= 32;
putchar(tmp);
}
system("pause");
return 0;
}