Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,c;
- char nr[1000];
- cin>>n;
- for(int i=0;i<n;++i)
- cin>>c,cout<<c,nr[i]=c;
- bool ok=true;
- for(int i=0;i<=n/2;++i)
- if(nr[i]!=nr[n-i-1])
- {
- ok=false;
- break;
- }
- cout<<'\n';
- if(ok)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement