rt,代码如下
#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <algorithm>
using namespace std;
vector<string> v;
string s;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
while(cin >> s){
if(isalpha(s[0]) == 1){
for(auto &c : s){
c = tolower(c);
}
}
else if(isalpha(s[0]) == 2){
for(auto &c : s){
c = toupper(c);
}
}
else{
reverse(s.begin(),s.end());
}
v.push_back(s);
}
for(auto it = v.rbegin();it != v.rend();it++){
cout << *it << ' ';
}
return 0;
}