- 字符串还原
- 2017-10-16 21:46:17 @
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i=0;
char s1[10000],s2[10000],s3[10000];
scanf("%d",&n);
scanf("%s",s1);
scanf("%s",s2);
scanf("%s",s3);
/*printf("%d\n",(s1[0]-'a')+(s2[0]-'a'));
printf("%d\n",(s1[0]-'a')+(s3[0]-'a'));
printf("%d\n",(s3[0]-'a')+(s2[0]-'a'));
printf("%d\n",(s1[1]-'a')+(s2[1]-'a'));
printf("%d\n",(s1[1]-'a')+(s3[1]-'a'));
printf("%d\n",(s3[1]-'a')+(s2[1]-'a'));*/
if((((s1[0]-'a')+(s2[0]-'a'))==26)&&(((s1[1]-'a')-(s2[1]-'a'))!=0))
{
for(i=n-1;i>=0;i--)
{
printf("%c",s3[i]);
}
}
else if((((s1[0]-'a')+(s3[0]-'a'))==26)&&(((s1[1]-'a')-(s3[1]-'a'))!=0))
{
for(i=n-1;i>=0;i--)
{
printf("%c",s2[i]);
}
}
else if((((s2[0]-'a')+(s3[0]-'a'))==26)&&(((s2[1]-'a')-(s3[1]-'a'))!=0))
{
for(i=n-1;i>=0;i--)
{
printf("%c",s1[i]);
}
}
else puts(s1);
return 0;
}
1 条评论
-
聪明的猪 (xxz) LV 6 @ 2018-07-28 19:47:43
#include <iostream> int main(void) { using std::cout; using std::endl; cout << "我不知道!" << endl; return 0; }
- 1