Advertisement
FokaKefir

Házi NOV. 15

Nov 14th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main(){
  8.  
  9.     //freopen("file.in", "r", stdin);
  10.     //freopen("file.out", "w", stdout);
  11.     char s[101];
  12.     int n, i, j, ok=1;
  13.     cin>>n>>s;
  14.     j=n;
  15.     i=0;
  16.     while(i<j && ok){
  17.         if(s[i++]!=s[j--]) ok=0;
  18.     }
  19.     if(ok==1) cout<<"palindrom";
  20.     else cout<<"nem palindrom";
  21.  
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement