Advertisement
Guest User

2689

a guest
Jan 29th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. short c[1001], i, n, pal;
  5. int main()
  6. {
  7. cin >> n;
  8.  
  9. for (i=0; i<n; ++i)
  10.  
  11. {
  12.  
  13. cin >> c[i];
  14.  
  15. }
  16. for (i=0; i<n; ++i)
  17.  
  18. cout << c[i];
  19.  
  20. cout << "\n";
  21.  
  22. pal=1;
  23. for (i=0; i<n/2; ++i)
  24.  
  25. if (c[i]!=c[n-i-1]) { pal=0; break; }
  26.  
  27. if (pal) cout << "DA";
  28.  
  29. else cout << "NU";
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement