Pagini recente » Borderou de evaluare (job #2346731) | Cod sursa (job #2348871) | Cod sursa (job #2352166) | Cod sursa (job #2348872) | Cod sursa (job #2393319)
var fin,fout:textfile;
a,b,c,d,i,n:longint;
function fc(var a:longint):longint;
var b,i:longint;
begin
b:=1;
for i:=1 to a do
b:=b*a;
fc:=b;
end;
begin
assign(fin,'cifra.in');
reset(fin);
assign(fout,'cifra.out');
rewrite(fout);
readln(fin,n);
for i:=1 to n do begin
readln(a);
for i:=1 to a do
b:=b+fc(i);
writeln(fout,b mod 10);
end;
end.