Okay, so you will have somewhere between 12 and 21 numbers in your file depending on how many strikes were thrown (excluding the first number telling you how many balls were thrown). I would define an array of 21 ints, and initialize them all to zero. Then, I would read in the scores ball by ball into the array.
Once you have all your input, you can do something like the following:
Code:
frame = 1
total = 0
for ball from 0 to num_balls_thrown - 1
if the score for this ball is 10
frame_score = add current and next two balls
print "strike"
increment i by 1
else if the score for this ball and the next ball total 10
frame_score = add current and next two balls
print "spare"
increment i by 2
else
frame_score = add current and next ball
increment i by 2
total += frame_score
print frame, frame_score and total
Note that this might not work for the 10th frame since that's a bit special, but this should get you well on your way.