Var n,sum,sum2,d,ind,i,j:integer; sred :double; begin Write('n'); Readln(n); d:=1; ind:=3; sum:=0; sum2:=0;sred:=0; for i:=0 to ind-1 do begin sum:=sum+(n div d) mod 10; sred:=sum/3; sum2:=sum2+ sqr((n div d) mod 10); d:=10*d; end; Writeln('suma ',Sum); Writeln('Sum 2 ',sum2); writeln('Sred ',sred:0:5); //Writeln('вывод цифр'); d:=1; for i:=0 to ind-1 do begin writeln((n div d) mod 10); d:=10*d; end; readln; end.
begin
Write('n');
Readln(n);
d:=1;
ind:=3;
sum:=0; sum2:=0;sred:=0;
for i:=0 to ind-1 do
begin
sum:=sum+(n div d) mod 10;
sred:=sum/3;
sum2:=sum2+ sqr((n div d) mod 10);
d:=10*d;
end;
Writeln('suma ',Sum);
Writeln('Sum 2 ',sum2);
writeln('Sred ',sred:0:5);
//Writeln('вывод цифр');
d:=1;
for i:=0 to ind-1 do
begin
writeln((n div d) mod 10);
d:=10*d;
end;
readln;
end.