#include<bits/stdc++.h>
using namespace std;
#define lld long long
lld n, i;
string s;
bool x;
int main()
{
cin >> n >> s;
for(int j=0; j<s.size()/2; ++j)
{
if(s[j]!=s[s.size()-j-1])
{
cout << "NIE";
x=true;
break;
}
}
if(x==false)
{
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<bits/stdc++.h> using namespace std; #define lld long long lld n, i; string s; bool x; int main() { cin >> n >> s; for(int j=0; j<s.size()/2; ++j) { if(s[j]!=s[s.size()-j-1]) { cout << "NIE"; x=true; break; } } if(x==false) { cout << "TAK"; } return 0; } |
English