Your loop at lines 35-42 is flawed. Once you find a match, you continue testing with the same c[i], therefore subsequent compares will match because you have not advanced i.
Suggestion: Break this into two loops. One to read in a,b,c and then one to assign the seat map.
Line 31: Your test for eof() is also flawed. After you've read R13E from the file, the eof bit is NOT set even though you read the last logical record. Therefore your loop executes one more time. The input operation at line 33 fails, but you don't check that and you proceed as if it had worked thereby proceeding with invalid values in a[37],b[37] and c[37]. Better to do this as:
|
while (theFile >> a[i] >> b[i] >> c[i])
|
Your program also assumes there will never be more than 38 seats reserved, however, there are 78 possible seats.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.