求查错

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

@[训练师杨永信](/space/show?uid=232429) 不要用gets,用cin试一试
by wudiss8 @ 2019-08-11 17:04:06


哥啊,string s就是一个字符串了,string s[8]就是一个字符串数组了,就是二维的了@[训练师杨永信](/space/show?uid=232429)
by _H1kar1 @ 2019-08-11 17:07:05


@[迪奥·布朗度](/space/show?uid=148949) 好像是的,~~谢谢大佬~~,谢谢老哥
by Aural_Psynapse @ 2019-08-11 17:10:03


应是char s1[8],s2[8]; string类型直接 string s1,s2就行了, 而且string类型求长度的方式是s1.length();不是strlen(s1);
by FCLockie @ 2019-08-11 17:10:46


@[LS_846](/space/show?uid=208174) 恩恩,一着急就弄错了
by Aural_Psynapse @ 2019-08-11 17:15:05


@[LS_846](/space/show?uid=208174) 依然50分啊老哥 ```cpp // luogu-judger-enable-o2 #include<bits/stdc++.h> using namespace std; int main() { char s1[8],s2[8]; int l1,l2,ans1=1,ans2=1; cin>>s1>>s2; for(int i=0;i<strlen(s1);i++) ans1*=s1[i]-'@'; for(int j=0;j<strlen(s2);j++) ans2*=s1[j]-'@'; ans1%=47; ans2%=47; if(ans1==ans2) cout<<"GO"; else cout<<"STAY"; return 0; } ```
by Aural_Psynapse @ 2019-08-11 17:20:01


@[训练师杨永信](/space/show?uid=232429) 第2个循环是ans2*=s2[j]-'@
by Skyjoy @ 2019-08-11 17:27:11


@[Skyjoy](/space/show?uid=178556) ~~恍然大悟~~ 手残党惯犯
by Aural_Psynapse @ 2019-08-11 17:34:53


|