Cod sursa(job #355592)
| Utilizator | Data | 11 octombrie 2009 18:36:59 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
program cifra;
var a:array[1..100]of integer;
n,i,j,c,s,x,l:longint;
f1,f2:text;
begin
assign(f1,'cifra.in'); reset(f1);
assign(f2,'cifra.out'); rewrite(f2);
readln(f1,n);
for i:=1 to n do
readln(f1,a[i]);
s:=1;
for i:=1 to n do
begin
s:=0;
for j:=1 to a[i] do
begin
c:=1;
x:=j;
for l:=1 to x do
begin
c:=c*x;
c:=c mod 10;
end;
s:=s+c;
s:=s mod 10;
end;
writeln(f2,s);
end;
close(f1);
close(f2);
end.
