Now, if you want to store each value, the best way is arrays.
It would be something like int avg_num[9999]; Then you just set the assign the number to each of the avg_num (i.e. avg_num[0] = 1; avg_num[1] = 5). But in this case, no real use for storing the values anyways.
In this case, I used vectors:
http://www.cs.ucr.edu/~ttaing/gpa_calculator.php . Just a GPA calculator, but takes the same idea as averaging values and reading in string to determine the value. As you can see, I can make the code run more efficently, but I'm not too worried about that. There are numerous ways to solve your problem, right now, just worry about getting it right, then optimizing the code later.