#include
#include
#include
using namespace std;
double Sum(int *A, int N, int C, int M);
int main()
{
srand(time(0));
int N, C = 19, M = 30;
cout << "N = ", cin >> N;
int Train[N];
for(int i = 0; i < N; i++)
cout << (Train[i] = rand() % (M+1)) << " ";<br> cout << "\nSum = " << Sum(&Train[0], N, C, M);;<br> return 0;
}
double Sum(int*A, int N, int C, int M)
{
double S = 0;
int k = 0;
for(int i = 0; i < N; i++)
{
S += A[i]*C;
k +=M - A[i];
}
cout << "\nk = " << k;<br> return S;
}