fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm> // do funkcji reverse
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. string x;
  9. cin >> x;
  10.  
  11. string y = x;
  12. reverse(y.begin(), y.end());
  13.  
  14. if (x == y) {
  15. cout << "TAK";
  16. } else {
  17. cout << "NIE";
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5324KB
stdin
kajak
stdout
TAK