попробуй
programm dima;
var
m1:array[1..50]of integer;
m2:array[1..50]of integer;
n1,n2,i:integer;
arifm1,arifm2:real;
begin
writeln('Vvedite rozmeri masivov');
readln(n1,n2);
randomize;
writeln('Masiv 1:');
for i :=1 to n1 do
m1[i]:=random(50);
write(m1[i],' ');
end;
writeln;
writeln('Masiv 2:');
for i:=1 to n2 do
m2[i]:=random(60);
write(m2[i],' ');
arifm1:= arifm1+m1[i];
arifm1:=arifm1/n1;
for i :=1 to n2 do
arifm2:= arifm2+m2[i];
arifm2:=arifm2/n2;
if arifm1=arifm2 then
writeln('seredne arifmetichne rovnie')
else
if arifm1>arifm2 then
writeln('seredne arifmetiche 1 masiva bilche')
writeln('seredne arifmetiche 2 masiva bilche');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
попробуй
programm dima;
var
m1:array[1..50]of integer;
m2:array[1..50]of integer;
n1,n2,i:integer;
arifm1,arifm2:real;
begin
writeln('Vvedite rozmeri masivov');
readln(n1,n2);
randomize;
writeln('Masiv 1:');
for i :=1 to n1 do
begin
m1[i]:=random(50);
write(m1[i],' ');
end;
writeln;
writeln('Masiv 2:');
for i:=1 to n2 do
begin
m2[i]:=random(60);
write(m2[i],' ');
end;
for i :=1 to n1 do
arifm1:= arifm1+m1[i];
arifm1:=arifm1/n1;
for i :=1 to n2 do
arifm2:= arifm2+m2[i];
arifm2:=arifm2/n2;
writeln;
if arifm1=arifm2 then
writeln('seredne arifmetichne rovnie')
else
if arifm1>arifm2 then
writeln('seredne arifmetiche 1 masiva bilche')
else
writeln('seredne arifmetiche 2 masiva bilche');
end.