Pagini recente » Cod sursa (job #662822) | Cod sursa (job #515284) | Cod sursa (job #2118820) | Cod sursa (job #3239315) | Cod sursa (job #26109)
Cod sursa(job #26109)
var f,g:text;t,i:integer;
x:longint;
function inv(n:longint):longint;
var io:longint;
begin
io:=0;
while n<>0 do begin
io:=io*10+(n mod 10);
n:=n div 10;end;
inv:=io;
end;
begin
assign(f,'invers.in');
reset(f);
assign(g,'invers.out');
rewrite(g);
readln(f,t);
for i:=1 to t do begin
readln(f,x);
if x=x*inv(x) then writeln(g,'DA')
else writeln(g,'NU');
end;
close(f);close(g);
end.