You could use two arrays, one for blue and one for red with 9 elements each.
int redVotes[9];
int blueVotes[9];
Make sure to initialize both arrays with 0. (Hint: Use memset)
When you have filtered out the valid input value pairs, you split each pair into one high (blue) and one low (red) value.
[UPDATE]
One problem with the input approach you have chosen is that you are supposed to ignore numbers with 3 or more digits. This requires that you either can predict the future or have some sort of rollback functionality.
Maybe something like this. Just beware that I wrote this code here in this editor and it is not tested at all.
char c;
int digit = 0;
int digits = 0;
int redIndex = 0;
int blueIndex = 0;
while (scanf("%c", &c) != EOF)
{
if (isdigit(c))
{
digits++;
digit = c -'0'; if (digits == 1)
redIndex = digit;
else if (digits == 2)
blueIndex = digit;
}
else
{
if (digits == 2)
{
redVotes[redIndex]++;
blueVotes[blueIndex]++;
}
digits = 0;
}
}
This part is not necessary anymore
int input = 35; int redValue = 5;
int blueValue = 3;
(Hint: Use modulus for the red value and integer division for the blue value)
Then you use the each indvidual value as an index in each of the two arrays and increment the value for that index.
redVotes[redValue]++;
blueVotes[blueValue]++;
Then it is just a matter of finding the max value of each array, combine the values and you have a winner.
If you cannot find a unique max value for one of the arrays, the result is indecisive.
So, that should get you started. I have not solved everything for you, just showed you one way of many to do it.