<swustoj>?id=563 String
链接http://acm.swust.edu.cn/problem/563/
#include <stdio.h> #include <string.h> int main() { char str[105]; while(scanf("%s",str)!=EOF) { int leng = strlen(str),i; for(i = 0 ; i< leng ; i ++) { if(str[i]>='a'&&str[i]<='z') { str[i]=str[i]-32; } else if(str[i]>='A'&&str[i]<='Z') { str[i]=str[i]+32; } } printf("%s\n",str); } return 0; }