Pagini recente » Cod sursa (job #536617) | Cod sursa (job #2273742) | Cod sursa (job #1494064) | Cod sursa (job #3150580) | Cod sursa (job #141131)
Cod sursa(job #141131)
program p21;
var f,g:text;
a:array [1..10000]of integer;
aux,i,j,n,c,x:longint;
ok:boolean;
begin
assign(f,'invers.in');reset(f);
assign(g,'invers.out');rewrite(g);
readln(f,n);
for i:=1 to n do
readln(f,a[i]);
for i:=1 to n do
begin
if a[i]=1 then writeln(g,'NU')
else begin
for j:=1 to a[i] do
begin
aux:=j;
x:=0;
while aux>0 do
begin
c:=aux mod 10;
aux:=aux div 10;
x:=x*10+c;
end;
if (j+x=a[i]) then begin
writeln(g,'DA');
ok:=true;
break;
end;
end;
if ok=false then writeln(g,'NU');
end;
end;
close(f);
close(g);
end.