Advertisement
a53

PalXXL

a53
Dec 1st, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,c;
  7. char nr[1000];
  8. cin>>n;
  9. for(int i=0;i<n;++i)
  10. cin>>c,cout<<c,nr[i]=c;
  11. bool ok=true;
  12. for(int i=0;i<=n/2;++i)
  13. if(nr[i]!=nr[n-i-1])
  14. {
  15. ok=false;
  16. break;
  17. }
  18. cout<<'\n';
  19. if(ok)
  20. cout<<"DA";
  21. else
  22. cout<<"NU";
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement