样例过,但全WA
查看原帖
样例过,但全WA
773371
Dreeick楼主2023/6/20 17:57

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;
}
2023/6/20 17:57
加载中...