#include <iostream>
#include <ctime>
using namespace std;
int main()
{
int n[10],a,b;
float s;
cout<<"OT: ";cin>>a;
cout<<"DO: ";cin>>b;
srand(time(0));
for (int i = 0; i<sizeof(n)/sizeof(int);i++)
n[i] = a+rand()%b;
}
cout <<"Все числа: ";
for (int i = 0;i<sizeof(n)/sizeof(int);i++)
cout<<" "<<n[i];
s = s + n[i];
cout<<endl<<"ITOG: "<<s/(sizeof(n)/sizeof(int));
return 0;
Объяснение:
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
int n[10],a,b;
float s;
cout<<"OT: ";cin>>a;
cout<<"DO: ";cin>>b;
srand(time(0));
for (int i = 0; i<sizeof(n)/sizeof(int);i++)
{
n[i] = a+rand()%b;
}
cout <<"Все числа: ";
for (int i = 0;i<sizeof(n)/sizeof(int);i++)
{
cout<<" "<<n[i];
s = s + n[i];
}
cout<<endl<<"ITOG: "<<s/(sizeof(n)/sizeof(int));
return 0;
}
Объяснение: