求错误在哪

P1200 [USACO1.1] 你的飞碟在这儿 Your Ride Is Here

@[xxx2018cy](/space/show?uid=105747) string从0开始,即: ```cpp string s; s==s[0]+s[1]+s[2]+......+s[s.length()-1] ```
by 吴勉之 @ 2019-03-20 16:36:37


@[xxx2018cy](/space/show?uid=105747) hj=hj*(b[i]-'64');和zj=zj*(c[i]-'64');也是错的 应为hj=hj*(b[i]-'A'+1);和zj=zj*(c[i]-'A'+1);
by 吴勉之 @ 2019-03-20 16:41:52


@[xxx2018cy](/space/show?uid=105747) 总的就是: ```cpp #include<bits/stdc++.h> using namespace std; int main() { string b,c; int i; long int hj=1,zj=1; cin>>b>>c; for(i=0;i<b.length();i++) hj=hj*(b[i]-'A'+1); for(i=0;i<c.length();i++) zj=zj*(c[i]-'A'+1); if(zj % 47==hj % 47) cout<<"GO"; else cout<<"STAY"; return 0; } ```
by 吴勉之 @ 2019-03-20 16:43:19


谢谢大佬
by xxx2018cy @ 2019-04-03 14:55:18


|