Pal

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <iostream>

#include <cstring>

using namespace std;


int main(){
char v[31], nume2[31],x;
int cntpal=0,cntvoc=0,i=0,cnt=0,cntvoc1=0,n;
cin >> n;
for(i=1; i<=n; ++i){
cin >> v;
cnt=strlen(v);
cntvoc=cnt/2;
cntvoc1=cnt/2;
--cnt;
while(cntvoc){
if(v[i] == v[cnt-i])
++cntpal;
--cntvoc;
++i;
}
if(cntvoc1 == cntpal)
cout << "DA";
else
cout << "NU";
}
return 0;
}

You might also like