#include <iostream>
#include <string>
using namespace std;
int main()
{
long x;
cin>>x;
string s;
cin>>s;
if(!x) x=s.length();
long y=x/2;
x--;
for(long i=0; i<y; i++)
{
if(s[i]!=s[x])
{
cout<<"NIE";
return 0;
}
x--;
}
cout<<"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 | #include <iostream> #include <string> using namespace std; int main() { long x; cin>>x; string s; cin>>s; if(!x) x=s.length(); long y=x/2; x--; for(long i=0; i<y; i++) { if(s[i]!=s[x]) { cout<<"NIE"; return 0; } x--; } cout<<"TAK"; return 0; } |
English