Pagini recente » Cod sursa (job #1643589) | Cod sursa (job #1486845) | Cod sursa (job #1609340) | Cod sursa (job #228224) | Cod sursa (job #223466)
Cod sursa(job #223466)
uses crt;
var t,n,s,i,c,x:integer; s: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[n];
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(fs,s);
end;
end.