User input into array

I need help on how to store user input into an array. The program needs to store between 1-50(exact value is unknown) numbers into the array. How do I set up the code so that the user can enter scores into the array so I can average them?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
using namespace std;

int main()
{	int size;
	cin >> size;
int *array = new int [size];
double average=0;

for(int i=0; i<size; i++)
{   cin >> array[i]; 
     average = ( i*average +array[i]) / (i+1);
}

cout <<average;

delete[] array;     
return 0;
}
Topic archived. No new replies allowed.