Pagini recente » Cod sursa (job #1371927) | Cod sursa (job #521083) | Cod sursa (job #377316) | Cod sursa (job #847928) | Cod sursa (job #223493)
Cod sursa(job #223493)
var t,n,s,i,c,x,j:longint; f,f2:text; v:array[1..100] of integer;
begin
assign(f,'cifra.in');
reset(f);
readln(f,t);
For i:=1 to t DO
readln(f,v[i]);
close(f);
assign(f2,'cifra.out');
rewrite(f2);
For x:=1 to t DO
begin
s:=0;
n:=v[x];
For i:=1 to N Do
begin
c:=1;
For j:=1 to i Do
begin
c:=c*i;
c:=c mod 10;
end;
s:=s+c;
s:=s mod 10;
end;
writeln(f2,s);
end;
close(f2);
end.