Подпрограмму
procedure rez(x,y:real):real;
begin
... rez=xxxxxx'
end;
redln(y);
z:=rez(x,y);
writeln(z);
.....
Var n,a,i,s,k:integer;
begin
write('n='); readln(n);
k:=0;
for i:=1 to n do
begin
write('a='); readln(a);
s:=0;
while a<>0 do
begin
s:=s+a mod 10;
a:=a div 10;
end;
writeln(' sum=',s);
if s mod 3 =0 then k:=k+1;
end;
writeln('k=',k);
<span>end.</span>