Advertisement
Guest User

palindrom

a guest
Oct 19th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     char s[50];
  7.     cin>>s;
  8.     int i,ok=1,n=strlen(s);
  9.     for(i=0; i<n/2; i++) if(s[i]!=s[n-1-i]) ok=0;
  10.     if(ok) cout<<"palindrom";
  11.     else cout<<"nu este palindrom";
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement