попробуй
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.
#include <iostream>
using namespace std;
int main(void)
{float x,y,z=0;
cin>>x>>y>>z;
if(x+y+z<1)
{float min=x;
if (min>y) min=y;
if (min>z) min=z;
if (min==x) x=(y+z)/2;
if (min==y) y=(x+z)/2;
if (min==z) z=(x+y)/2;}
else
if(x>y) y=(x+z)/2; else x=(y+z)/2;
cout<<x<<" "<<y<<" "<<z<<" ";
return 0;}
Пример ввода:
1.1
2.2
3.3
Пример вывода:
2.75 2.2 3.3