```cpp
s *= a[i]-'A'+1;
```
by 正式AFO @ 2018-11-02 09:19:38
您试一下@[顾里](/space/show?uid=140043)
by 正式AFO @ 2018-11-02 09:19:56
@[5743377_2002](/space/show?uid=36701) 还是不对啊大佬..
by 顾里 @ 2018-11-02 09:22:57
你的循环出了点问题
```cpp
for(i=0;i<strlen(a);++i)
```
它的长度不一定是6,空格也是有值的,乘出来的值就是错误的
所以用strlen(a)来表示a的长度,它是从0开始存的
不过我有个建议,刚学OI最好先不要用万能头
by HYR2018 @ 2018-11-02 09:29:28
用strlen求长度,再循环
by 正式AFO @ 2018-11-02 09:29:31
是的, 万能头先别用, 老老实实打头文件@[顾里](/space/show?uid=140043)
by 正式AFO @ 2018-11-02 09:30:44
@[5743377_2002](/space/show?uid=36701) 可是改了还是不对啊大佬.....
by 顾里 @ 2018-11-02 09:36:53
@[HYR2018](/space/show?uid=103309) 改了还是50分吖大佬..
by 顾里 @ 2018-11-02 09:37:41
```cpp
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[7],b[7];
int main()
{
gets(a);
gets(b);
int s=1,t=1,n,m,i;
for(i=0;i<strlen(a);++i)
s*=(a[i]-64);
for(i=0;i<strlen(b);++i)
t*=(b[i]-64);
n=s%47;
m=t%47;
if(n==m)
cout<<"GO"<<endl;
else
cout<<"STAY"<<endl;
return 0;
}
```
这个代码90分,第一个测试点有点玄学,DEV是对的,洛谷编译器是错的
by HYR2018 @ 2018-11-02 09:40:10
我之前使用string的字符串,不知道你们学了没,给你参考参考代码
```cpp
#include<iostream>
#include<cstring>
using namespace std;
string s1,s2;
int sum1=1,sum2=1;
int main()
{
cin>>s1>>s2;
for(int i=0;i<s1.length();++i)
sum1*=s1[i]-'A'+1;
for(int i=0;i<s2.length();++i)
sum2*=s2[i]-'A'+1;
if(sum1%47==sum2%47)
{
cout<<"GO";
return 0;
}
cout<<"STAY";
return 0;
}
```
by HYR2018 @ 2018-11-02 09:44:16