Cod sursa(job #561472)
| Utilizator | Data | 20 martie 2011 15:31:39 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
var i,s,j,t,n,u,p:longint;
function pt(x:integer):integer;
begin
p:=1;
for j:=1 to i do
begin
p:=p*i;
end;
pt:=p
end;
begin
assign(input,'cifra.in');reset(input);
assign(output,'cifra.out');rewrite(output);
readln(t);
while not eof(input) do
begin
readln(n);
for i:=1 to n do
begin
s:=s+pt(i) mod 10;
end;
writeln(s mod 10);
s:=0;
end;
close(input);
close(output);
end.
