P1200 [USACO1.1]你的飞碟在这儿Your Ride Is Here
#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 = sum1 * (a[i] - 64);//A-->1 则65-1=64
int sum2 = 1;
for (int i = 0; i < b.size(); i++)
sum2 = sum2 * (b[i] - 64);
if (sum1 % 47 == sum2 % 47) cout << "GO" << endl;
else cout << "STAY" << endl;
return 0;
}