Mai intai trebuie sa te autentifici.
Cod sursa(job #2214)
Utilizator | Data | 16 decembrie 2006 13:41:53 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
var n,i,l,j,c,x,y,t:integer;
f,g:text;
begin
assign(f,'cifra.in');reset(f);
assign(g,'cifra.out');rewrite(g);
readln(f,T);
for l:=1 to T do
begin
readln(f,n);
x:=0;
for i:=1 to n do
begin y:=i; c:=i mod 10 ;
for j:=1 to y-1 do
begin
c:=y*c;
c:=c mod 10;
end;
x:=x+c;
x:=x mod 10;
end;
writeln(g,x);
end;
close(f);close(g);
end.