Pagini recente » Cod sursa (job #2865816) | Cod sursa (job #2183411) | Cod sursa (job #567313) | Cod sursa (job #2696019) | Cod sursa (job #223481)
Cod sursa(job #223481)
uses crt;
var t,n,s,i,c,x,j:longint; f,f2:text; v:array[1..100] of integer;
begin
clrscr;
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.