Cod sursa(job #223493)

Utilizator alexu128Rosu Alexandru alexu128 Data 28 noiembrie 2008 18:02:14
Problema Cifra Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.52 kb
var t,n,s,i,c,x,j:longint; f,f2:text;  v:array[1..100] of integer;
begin
     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[x];
     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(f2,s);
     end;
     close(f2);
end.