- 字符串还原
- 2018-09-14 21:01:22 @
#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;
}
//给奆佬递猹(手动滑稽)