Pagini recente » Cod sursa (job #1037599) | Cod sursa (job #471076) | Cod sursa (job #2971784) | Cod sursa (job #1744472) | Cod sursa (job #444426)
Cod sursa(job #444426)
var uc,i,m,n,c,t:longint;
x:array[1..9] of integer;
f,g:text;
begin
assign(f,'cifra.in'); reset(f);
assign(g,'cifra.out'); rewrite(g);
x[1]:=1;
x[2]:=5;
x[3]:=2;
x[4]:=8;
x[5]:=3;
x[6]:=9;
x[7]:=2;
x[8]:=8;
x[9]:=9;
read(f,t);
for i:=1 to t do begin
read(f,n);
c:=n mod 10;
m:=n div 10;
uc:=m*x[9];
uc:=uc+x[c];
uc:=uc mod 10;
writeln(g,uc);
end;
close(g);
close(f);
end.