Odpowiedź:
#include <iostream>
using namespace std;
int main()
{
srand(time(NULL));
int n;
cout << "n: ";
cin >> n;
int* arr = new int[n];
for (int i=0;i<n;i++)
arr[i] = rand()%12 + 1;
int suma=0;
for (int i=0;i<n;i++)
suma+=arr[i];
cout << "suma: " << suma;
delete[] arr;
}