April Fools Contest 2017 D

Description

Input

The only line of the input contains a string of digits. The length of the string is between 1 and 10, inclusive.

Output

Output "Yes" or "No".

Examples
input
373
output
Yes
input
121
output
No
input
436
output
Yes
看是不是回文(436中4,6盲文对称)

 1 #include<cstdio>
 2 #include<iostream>
 3 #include<cstring>
 4 using namespace std;
 5 
 6 int s[]={8,-1,-1,-1,6,9,4,-1,0,5};
 7 char st[12313];
 8 
 9 int main()
10 {
11     scanf("%s",st+1);int n=strlen(st+1);
12     for(int i=1,j=n;i<j;i++,j--)
13         if(st[i]!=st[j]&&s[st[i]-'0']!=st[j]-'0') return 0*puts("No");
14     if(n&1){if(st[n/2+1]!='3'&&st[n/2+1]!='7')return 0*puts("No");}
15     puts("YES");
16     return 0;
17 }

 

posted @ 2017-04-02 21:00  樱花落舞  阅读(237)  评论(0编辑  收藏  举报