Is Palindrome | Toph | Easy Problem c++

 

Is Palindrome | Toph | Easy Problem c++


Is Palindrome | Toph | Easy Problem c++

Given a word, print \texttt{Yes} if it is a palindrome, otherwise \texttt{No}.

A palindrome is a word which reads the same backward as forward, e.g. racecar.

Input

The input will contain a string S (0 < \texttt{Length of S} < 100).

S will contain lowercase alphabets only.

Output

Print \texttt{Yes} or \texttt{No}.



Code C++







#include<bits/stdc++.h>

using namespace std;

int main()
{

    string a,p;
    
    cin>>a;
	
    p=a;
    reverse(a.begin(),a.end());
    
    
    if(a==p){
    cout<<"Yes"<<endl;
    }else{
    
    cout<<"No"<<endl;
    }
    
    return 0;
}

Post a Comment

0 Comments