- 判断是否构成回文
 xhz
- @ 2023-11-12 9:49:22
 
#include <bits/stdc++.h>
using namespace std;
int main()
{
    char a[101]={0},b;
    int i=0;
    cin>>b;
    while(b!='.')
    {
        a[i]=b;
        i++;
        cin>>b;
    }
    i--;
    for(int j=0;j<=i;j++,i--)
    {
        if(a[j]!=a[i])
        {
            cout<<"no";
            return 0;
        }
    }
    cout<<"yes";
    return 0;
        0 comments
  
  No comments so far...
            Information
- ID
 - 815
 - Time
 - 1000ms
 - Memory
 - 256MiB
 - Difficulty
 - 8
 - Tags
 - # Submissions
 - 115
 - Accepted
 - 28
 - Uploaded By