提交时间:2024-04-26 15:48:14
运行 ID: 46133
#include<iostream> #include<cstring> using namespace std; char a[7],b[7]; int main() { cin>>a>>b; int S1,S2; S1=1; S2=1; for(int i=0;i<strlen(a);i++){ S1*=(a[i]-'A'+1); } for(int i=0;i<strlen(b);i++){ S2*=(b[i]-'A'+1); } S1%=47; S2%=47; if(S1==S2){ cout<<"GO"; } else{ cout<<"STAY"; } return 0; }