6,9,10WA希望奆佬来挑错

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
string x;
bool judge(string a,string b,string c){
reverse (a.begin(),a.end());
x=a;
bool ans=0;
for(int k=0;k<=6;k++){
if(((b[0]-'a'+k)==(x[0]-'a')) && ((c[0]-'a'-k)==(x[0]-'a'))) {
ans=1;
break;
}
}
return ans;
}
int main(){
int n;
string a,b,c;
cin>>n>>a>>b>>c;
if(judge(a,b,c)) {
cout<<x;
}
else if(judge(b,a,c)) {
cout<<x;
}
else if(judge(c,a,b)) {
cout<<x;
}
else if(judge(a,c,b)) {
cout<<x;
}
else if(judge(b,c,a)) {
cout<<x;
}
else if(judge(c,b,a)) {
cout<<x;
}
return 0;
}
//给奆佬递猹(手动滑稽)

0 条评论

目前还没有评论...

信息

ID
1449
难度
6
分类
字符串 | 模拟 点击显示
标签
递交数
6903
已通过
1850
通过率
27%
被复制
9
上传者