十万火急!WA了
查看原帖
十万火急!WA了
757409
Flying_Eagle楼主2023/5/9 19:55
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
string s, str;

int main() {
	cin >> n >> m >> k;
	cin.ignore();
	getline(cin, s);
	int index = 0;
	if ( !s.empty()) {
		while ( (index = s.find(' ', index)) != string::npos) {

			s.erase(index, 1);
		}
	}
	getline(cin, str);
	index = 0;
	if ( !str.empty()) {
		while ( (index = str.find(' ', index)) != string::npos) {
			str.erase(index, 1);
		}
	}
	if (n > m) {
		cout << "Y";
	} else if (n < m) {
		cout << "X";
	} else {
		if (s > str) {
			cout << "Y";
		} else if (s == str) {
			cout << "Same";
		} else {
			cout << "X";
		}
	}
	return 0;
}
2023/5/9 19:55
加载中...