Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- bool Palindrom(string s){
- if(s.length()<=1){
- return true;}else{
- char primul=s[0];
- char ultimul=s[s.length()-1];
- if(primul==ultimul){
- string mijloc=s.substr(1,s.length()-2);
- bool tt=Palindrom(mijloc);
- return tt;
- }
- else{return false;}}
- }
- int main(){
- string s;
- cin>>s;
- cout<<Palindrom(s);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement