@[qew12312](/user/916027) 用字符数组存储时最后一位是`\0`,所以数组要开大一位
by I_love_STL @ 2023-01-03 13:57:37
```cpp
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{char b[7],c[7];int t=1,r=1;
cin.getline(b,7,'\n');
cin.getline(c,7,'\n');
for(int i=0;i<strlen(b);i++){
t=t*(b[i]-'A'+1);
}
for(int i=0;i<strlen(c);i++){
r=r*(c[i]-'A'+1);
}
if(t%47==r%47) cout<<"GO";
else cout<<"STAY";
return 0;
}
```
改成这样就行了
by I_love_STL @ 2023-01-03 13:58:30
谢谢大佬,新年快乐!
by qew12312 @ 2023-01-03 14:31:33