I think the key here is the valid values are between 0-10 . I would use an array index to store each value. For example, if you process a value of 5, an increment values[5].
So, first you must initialize the array, for example:
int[] values = new int[11]; //Values 0-10
, :
while(true)
{
string inValue = Console.ReadLine();
if(String.IsNullOrEmpty(inValue)) break;
values[Convert.ToInt32(inValue)]++;
}
, 0:
for(int i = 0; i < values.length; i++)
{
if(values[i] > 0)
{
Console.WriteLine("Value {0} was entered {1} time(s)..", i, values[i]);
}
}
, , , . , :)