回文素数

 1 #include<cstdio> 
 2 #include<iostream>
 3 #include<cstring>
 4 using namespace std;
 5 char ch, letter[101];
 6 int i=1;
 7 int main()
 8 {
 9     printf("Input a string:");
10     scanf("%s", letter+1);
11     int a=1, b=strlen(letter+1);
12     b--;
13 //    cin>>ch;
14 //    while(ch!='.')
15 //    {
16 //        letter[i]=ch;
17 //        i++;
18 //        cin>>ch;
19 //    }
20     while(letter[a] == letter[b]&&(b>=1)) 
21     {
22         a++;
23         b--;
24     }
25     if(b==0) printf("Yes");
26     else printf("No");
27     return 0; 
28 }

想打‘.’也可以。。。(某人说并没有什么用)

posted @ 2019-12-07 09:44  orange_lyc  阅读(105)  评论(0编辑  收藏  举报