You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
386 B

#include<bits/stdc++.h>
using namespace std;
string a;
string B;
int main() {
cin >> a >> b;
int sum1 = 1;
for (int i = 0; i < a.size(); i++) sum1 *= a[i] - 64;//A-->1 则65-1=64
int sum2 = 1;
for (int i = 0; i < b.size(); i++) sum2 *= b[i] - 64;
if (sum1 % 47 == sum2 % 47) cout << "GO" << endl;
else cout << "STAY" << endl;
return 0;
}