#include <iostream>
using namespace std;
int n;
string slowo;
bool czy;
int main()
{
cin >> n >> slowo;
for(int i=0; i<=slowo.length()/2-1; i++)
{
if(slowo[i]!=slowo[slowo.length()-i-1])
{
czy = true;
break;
}
}
if(czy == false) cout << "TAK";
else cout << "NIE";
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 <iostream> using namespace std; int n; string slowo; bool czy; int main() { cin >> n >> slowo; for(int i=0; i<=slowo.length()/2-1; i++) { if(slowo[i]!=slowo[slowo.length()-i-1]) { czy = true; break; } } if(czy == false) cout << "TAK"; else cout << "NIE"; return 0; } |
English