C++50分!Why?
查看原帖
C++50分!Why?
1023481
Jasondan楼主2024/11/6 20:49
#include <bits/stdc++.h>
using namespace std;
/*
1.读题
【问题条件】

2.思考
【建模算法】


3.编写
4.调试
5.回顾

*/


int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	//string s[300];
	int cnt1 = 0, cnt2 = 0;
	string s1, s2;
	cin >> s1 >> s2;
	for (int j = 0; j < s1.size(); j++) {
		cnt1 += s1[j]-64;
	}
	for (int j = 0; j < s2.size(); j++) {
		cnt2 += s2[j]-64;
	}

	if (cnt2 % 47 == cnt1 % 47) {
		cout << "GO";
	}
	else {
		cout << "STAY";
	}
	return 0;
}
2024/11/6 20:49
加载中...