#include <iostream>using std::cout;using std::endl;#include <cstdlib>using std::rand;using std::srand;#include <ctime>using std::time;int main(){ int a[28]; double average = 0; srand(time(0)); for(int i = 0; i < 28; i++) { a[i] = rand() % 11 + 2; average += a[i]; cout << a[i] << ' '; } cout << endl; average /= 28; cout << "Arithmetic mean = " << average << endl; return 0;}
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[28];
double average = 0;
srand(time(0));
for(int i = 0; i < 28; i++)
{
a[i] = rand() % 11 + 2;
average += a[i];
cout << a[i] << ' ';
}
cout << endl;
average /= 28;
cout << "Arithmetic mean = " << average << endl;
return 0;
}