将大写改为小写,小写改为大写,否则不变,用for循环
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
int repeat,ri;
char ch;
scanf("%d",&repeat);
for(ri=1;ri<=repeat;ri++)
{
ch=getchar();
if (ch>='a'&&ch<='z') ch=ch-32;
else if (ch>='A'&&ch<='Z') ch=ch+32;
else ch=ch;
putchar(ch);
}
return 0;
}