#include <iostream>
using namespace std;
int main()
{
int n, s1 = 0, s2 = 0, n1 = 0, n2 = 0;
cin >> n;
int a[n];
srand(time(0)); // инициализируем датчик
for(int i=0; i<n; i++)
a[i] = rand() % 101;
cout << a[i] << " ";
if(a[i] < 50)
n1++;
s1 += a[i];
}
else
n2++;
s2 += a[i];
double m1 = double(s1) / n1;
double m2 = double(s2) / n2;
cout << endl << m1 << " " << m2;
return 0;
#include <iostream>
using namespace std;
int main()
{
int n, s1 = 0, s2 = 0, n1 = 0, n2 = 0;
cin >> n;
int a[n];
srand(time(0)); // инициализируем датчик
for(int i=0; i<n; i++)
{
a[i] = rand() % 101;
cout << a[i] << " ";
if(a[i] < 50)
{
n1++;
s1 += a[i];
}
else
{
n2++;
s2 += a[i];
}
}
double m1 = double(s1) / n1;
double m2 = double(s2) / n2;
cout << endl << m1 << " " << m2;
return 0;
}