1 条题解
-
0lrj124 LV 5 @ 2017-04-15 13:18:59
#include <iostream> #include <cstdio> #include <string> using namespace std; int main() { //freopen("ride.in","r",stdin); //freopen("ride.out","w",stdout); string str1,str2; int a = 1,b = 1; getline(cin,str1); getline(cin,str2); for (unsigned i = 0;i < str1.length();i++) a = (a*(str1[i]-'A'+1))%47; for (unsigned i = 0;i < str2.length();i++) b = (b*(str2[i]-'A'+1))%47; printf("%s",a == b ? "GO" : "STAY"); return 0; }
- 1