Program raznost_xy; var x, y:integer; begin write ('Введите число х = '); readln (x); write ('Введите число у = '); readln (y);
if (x>0) and (y>0) then begin if abs(x)>abs(y) then write ('x-y > 0'); if abs(x)=abs(y) then write ('x-y = 0'); if abs(x)<abs(y) then write ('x-y < 0'); end;
if (x<0) and (y<0) then begin if abs(x)>abs(y) then write ('x-y < 0'); if abs(x)=abs(y) then write ('x-y = 0'); if abs(x)<abs(y) then write ('x-y > 0'); end;
if (x=0) and (y=0) then write ('x-y = 0'); if (x>0) and (y<0) then write ('x-y > 0'); if (x<0) and (y>0) then write ('x-y < 0'); if (x=0) and (y>0) then write ('x-y < 0'); if (x=0) and (y<0) then write ('x-y > 0'); if (x>0) and (y=0) then write ('x-y > 0'); if (x<0) and (y=0) then write ('x-y < 0'); end.
1.program z; var a:array [1..10] of integer; i,t:integer; s:real; begin for i:=1 to 10 do begin a[i]:=random(1,100); write(a[i]:4); if (odd(i)) and (odd(a[i])) then begin s:=s+a[i]; t:=t+1; end; end; writeln; write('Cреднее арифметическое = ',s/t); end. 2.program z; var a:array[1..10] of integer; max,i:integer; begin writeln('Исходный массив'); for i:=1 to 10 do begin a[i]:=random(1,100); write(a[i]:4); if a[i]>max then max:=a[i]; end; writeln; writeln('Измененный массив'); for i:=1 to 10 do begin if not(odd(a[i])) then a[i]:=max; write(a[i]:4); end; end.
var x, y:integer;
begin
write ('Введите число х = ');
readln (x);
write ('Введите число у = ');
readln (y);
if (x>0) and (y>0) then
begin
if abs(x)>abs(y) then write ('x-y > 0');
if abs(x)=abs(y) then write ('x-y = 0');
if abs(x)<abs(y) then write ('x-y < 0');
end;
if (x<0) and (y<0) then
begin
if abs(x)>abs(y) then write ('x-y < 0');
if abs(x)=abs(y) then write ('x-y = 0');
if abs(x)<abs(y) then write ('x-y > 0');
end;
if (x=0) and (y=0) then write ('x-y = 0');
if (x>0) and (y<0) then write ('x-y > 0');
if (x<0) and (y>0) then write ('x-y < 0');
if (x=0) and (y>0) then write ('x-y < 0');
if (x=0) and (y<0) then write ('x-y > 0');
if (x>0) and (y=0) then write ('x-y > 0');
if (x<0) and (y=0) then write ('x-y < 0');
end.
var a:array [1..10] of integer; i,t:integer; s:real;
begin
for i:=1 to 10 do
begin
a[i]:=random(1,100);
write(a[i]:4);
if (odd(i)) and (odd(a[i])) then
begin
s:=s+a[i];
t:=t+1;
end;
end;
writeln;
write('Cреднее арифметическое = ',s/t);
end.
2.program z;
var a:array[1..10] of integer; max,i:integer;
begin
writeln('Исходный массив');
for i:=1 to 10 do
begin
a[i]:=random(1,100);
write(a[i]:4);
if a[i]>max then max:=a[i];
end;
writeln;
writeln('Измененный массив');
for i:=1 to 10 do
begin
if not(odd(a[i])) then a[i]:=max;
write(a[i]:4);
end;
end.