Mai intai trebuie sa te autentifici.
Cod sursa(job #811580)
Utilizator | Data | 12 noiembrie 2012 18:00:40 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
program cifra;
var a,n,i,b,T,m:longint;
f1,f2:text;
begin
assign(f1,'cifra.in');
assign(f2,'cifra.out');
reset(f1); rewrite(f2);
readln(f1,T);
a:=1;
for m:=1 to T do
begin
b:=0;
readln(f1,n);
for i:=1 to n do
begin
a:=a*n;
b:=b+a;
end;
writeln(f2,b mod 10);
end;
close(f1);
close(f2);
end.