Need HELP with arrays and structures

Hi everyone,

This is my first time here. I'm learning C++ and I'm having trouble
with a problem. The question says there's a baseball team, identified by the numbers 1 through 20. Their records are coded as follows:
player's Identification #:
# of hits:
# of walks:
# of outs made in a game:

all in one line.
I don't understand how to write a code which checks if there
is more than one line for a player how do I sum the hits, walks, and outs, for that one player. Right now, I have one line of data for each player and it's working. I hope someone can help:
Here's my code:

// This program computes the batting average
// for a baseball team. There are 20 players
// on the team.

Thanks for replying Endo. I see what you mean about the index. I'm working on it, but I feel that isn't my problem. I tried to make four seperate arrays, but that isn't working either. Sorry about my coding.
Here's the whole question.

The local baseball team is computerizing its records. Write a program that computes batting averages. There are 20 players on the team, identified by the numbers 1 through 20. Their batting records are coded in a file as follows. Each line contains four numbers: the player's identification number and the number of hits, walks, and outs he or she made in a particular game. Here is a sample:
3 2 1 1
The example above indicates that during a game, player number 3 had 2 hits, 1 walk, 1 out. For Each player there are several lines in teh file. Each player's batting average is computed by adding the player's total number of hits and dividing by the hits + total outs. The program prints a table showing each player's identification number, batting average, and number of walks.