// Declare an array to hold the return values
int *freq = new int[numFaces+1];
// Initialize it
for (int a = 0; a freq[a] = 0;
// roll the dice for n times
for(int i = 0; i{
int j;
j = roll();
freq[j] += 1;
}
// return the results
return freq;
--文学城www.wenxuecity.com--