Problem Description
X现在要学习英文以及各种稀奇古怪的字符的了。现在他想把一串字符中的小写字母变成大写字符,大写字母变成小写字母,其他的保持不变。
Input
输入有多组。
每组输入一个字符串,长度不大于80,不包含空格。
Output
输出转换后的字符串
Example Input
A*
B+
Example Output
a*
b+
#include<stdio.h>
#include<string.h>
int main()
{
char a[81];
while(scanf("%s", a) != EOF)
{
int len = strlen(a), i;
for(i = 0; i < len; i++)
{
if(a[i] >= 'a' && a[i] <= 'z')
printf("%c", a[i]-32);
else if(a[i] >= 'A' && a[i] <= 'Z')
printf("%c", a[i]+32);
else printf("%c", a[i]);
}
printf("\n");
}
return 0;
}