Files
python/LuoGu/RuMen/P1200.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

30 lines
531 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}