Pagini recente » Borderou de evaluare (job #2567851) | Cod sursa (job #928535) | Cod sursa (job #429532) | Cod sursa (job #762857) | Cod sursa (job #444431)
Cod sursa(job #444431)
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);
writeln(g);
end;
close(g);
close(f);
end.