这个是代码
#include<bits/stdc++.h>
using namespace std;
char c[6005];
int i=0;
int main(){
string s;
while(cin >> s){
if(s[0] >= '0' && s[0] <= '9')
for(int j=0;j<s.size();j++)
c[i++]=s[j];
else
for(int j=s.size()-1;j>=0;j--)
if(s[j]>='a' && s[j]<='z')c[i++]=s[j]-32;
else c[i++]=s[j]+32;
i++;
}
for(i=i-2;i>=0;i--)printf("%c",c[i]);
return 0;
}