Pagini recente » Cod sursa (job #1755199) | Istoria paginii runda/bulangandit2/clasament | Cod sursa (job #1677170) | Cod sursa (job #1070516) | Cod sursa (job #470737)
Cod sursa(job #470737)
{info.arena-cifra
t-nr de valori ale lui n}
program cifra;
var t,i,j,s,v,x,er:integer;
n:array[1..240] of string ;
y:array[1..240] of integer;
f1,f2:text;
begin
assign(f1,'cifra.in');reset(f1);
assign(f2,'cifra.out');rewrite(f2);
readln(f1,t);
if (1<=t) and (t<=30000) then begin
for i:=1 to t do
begin
readln(f1,n[i]);
val(n[i],y[i],er);
if er=1 then write(f2,' ');
end;
x:=0;
v:=1;
s:=0;
for i:=1 to t do
begin
for j:=1 to y[i] do
v:=v*y[i];
s:=s+v;
v:=1;
if j=y[i] then begin x:=x+s;writeln(f2,x mod 10); s:=0; end;
end;
end;
close(f1);
close(f2);
end.