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.

30 lines
502 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include<iostream>
using namespace std;
//知识点字符串中字符的索引方式ASCII的数字转换64
int main() {
string a;
string b;
cin >>a>>b;
int sum1=1;
for(int i=0; i<a.length(); i++) {
int c=a[i]-64;
sum1=sum1*c;
}
int sum2=1;
for(int i=0; i<b.length(); i++) {
int c=b[i]-64;
sum2=sum2*c;
}
if(sum1%47==sum2%47) {
cout<<"GO"<<endl;
} else {
cout<<"STAY"<<endl;
}
return 0;
}