#include <cstdio>
#include <cstring>
using namespace std;
char str[3000005];
int main(){
int ile;
scanf("%d", &ile);
scanf("%s", str);
if(ile == 0) ile = strlen(str);
if(str[ile-1] == '\n') ile--;
for(int i = 0; i<ile/2; i++){
if(str[i] != str[ile-i-1]){
printf("NIE");
return 0;
}
}
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 | #include <cstdio> #include <cstring> using namespace std; char str[3000005]; int main(){ int ile; scanf("%d", &ile); scanf("%s", str); if(ile == 0) ile = strlen(str); if(str[ile-1] == '\n') ile--; for(int i = 0; i<ile/2; i++){ if(str[i] != str[ile-i-1]){ printf("NIE"); return 0; } } printf("TAK"); return 0; } |
English