Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int main(){
- //freopen("file.in", "r", stdin);
- //freopen("file.out", "w", stdout);
- char s[101];
- int n, i, j, ok=1;
- cin>>n>>s;
- j=n;
- i=0;
- while(i<j && ok){
- if(s[i++]!=s[j--]) ok=0;
- }
- if(ok==1) cout<<"palindrom";
- else cout<<"nem palindrom";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement