program rrr; uses crt; const n=9; type massiv=array[1..n]of real; var a:massiv; max,sr:integer; procedure vvod(var x:massiv); var i:integer; begin writeln('wwedite massiv'); for i:=1 to n do readln(x[i]); end; procedure vivod(x:massiv); var i:integer; begin for i:=1 to n do write(x[i]:6:2,' '); end; procedure sred_ar_i_max(x:massiv,var sr,max:real); var sum:real; i:integer; begin s:=0; for i:=1 to n do if x[i]>0 then s:=s+x[i]; end; sr:=s/n; for i:=1 to n do if (x[i]>0) and max<x[i] then max:=x[i]; end; vvod(a); clrscr; vivod(a); sred_ar_i_max(a,sr,max); writeln('max=',max:6:2,'srednee arifmet=',sr:6:2); readln; end.
program rrr;
uses crt;
const n=9;
type massiv=array[1..n]of real;
var a:massiv;
max,sr:integer;
procedure vvod(var x:massiv);
var i:integer;
begin
writeln('wwedite massiv');
for i:=1 to n do
readln(x[i]);
end;
procedure vivod(x:massiv);
var i:integer;
begin
for i:=1 to n do
write(x[i]:6:2,' ');
end;
procedure sred_ar_i_max(x:massiv,var sr,max:real);
var sum:real; i:integer;
begin
s:=0;
for i:=1 to n do
if x[i]>0 then s:=s+x[i];
end;
sr:=s/n;
for i:=1 to n do
if (x[i]>0) and max<x[i] then max:=x[i];
end;
vvod(a);
clrscr;
vivod(a);
sred_ar_i_max(a,sr,max);
writeln('max=',max:6:2,'srednee arifmet=',sr:6:2);
readln;
end.
1)
var
a,b,x,y:real;
begin
readln(a,b);
x:=(a+b)/2;
y:=2*a*b;
if a>b then
begin
a:=y;
b:=x;
end
else
begin
a:=x;
b:=y;
end;
writeln('a=',a:8:3);
writeln('b=',b:8:3);
end.
2)
var
d,m:integer;
begin
readln(d,m);
if (d<1) or (d>31) then writeln ('день введен неверно');
if (m<1) or (m>12) then writeln ('месяц введен неверно');
end.
3)
var
a,b,c:integer;
begin
readln(a,b,c);
if (a>b) and (a>c) then writeln(a);
if (b>a) and (b>c) then writeln(b);
if (c>a) and (c>b) then writeln(c);
end.