Cod sursa(job #223466)
Utilizator | Rosu Alexandru alexu128 | Data | 28 noiembrie 2008 17:24:57 |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
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.