#include <bits/stdc++.h> using namespace std; int s; bool kk; string a; int main () { scanf("%d",&s); cin>>a; s=a.size(); for (int i=0;i<s/2+1;i++) { if (a[i]!=a[s-1-i]) { kk=1; break; } } if (kk==1) printf("NIE"); else printf("TAK"); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <bits/stdc++.h> using namespace std; int s; bool kk; string a; int main () { scanf("%d",&s); cin>>a; s=a.size(); for (int i=0;i<s/2+1;i++) { if (a[i]!=a[s-1-i]) { kk=1; break; } } if (kk==1) printf("NIE"); else printf("TAK"); return 0; } |