Cod sursa(job #489859)
Utilizator | Data | 3 octombrie 2010 20:38:03 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
program ni;
uses crt;
var x,i,n,j:word;
s,c:longint;
f,g:text;
begin
assign(f,'cifra.in');
reset(f);
assign(g,'cifra.out');
rewrite(g);
readln(f,x);
for i:=1 to x do
begin
readln(f,n);
s:=0;
for i:=1 to n do
begin
c:=1;
for j:=1 to i do
c:=c*i;
s:=s+c;
end;
writeln(g,s mod 10);
end;
close(f);
close(g);
end.