console programming question

I am working on a console application that will open a file and read input data it has a date then a price such as:

01/02/2009 22.46

it'll take the highest out of the list of 20 or so then place it into the output file and then average of all of them and place it into an output file as well.

i have the following line of code for it, but i need to figure out how to ignore the 01/02/2009 and the other lines.

#include <iostream>
#include <fstream>

using namespace std;

int main()
{
const int LIMIT = 20;
int number = 0;
int sum = 0;
ofstream outFile;
ifstream inFile;

inFile.open("PriceHistory.txt");
if (inFile.fail())
{
cout << "Error: Failed to open input file." << endl;
exit(1);
}
for (int i = 0; i <= LIMIT; i++)
{
inFile >> number;
sum += number;
}
inFile.close();
outFile.open("PriceSummary.txt");
if (outFile.fail())
{
cout << "Error: Failed to open output file." << endl;
exit(1);
}
outFile << "Sum: " << sum;
outFile.close();
}

i'm thinking i got the for loop messed up, here is a copy of price history so you can get an idea of the file i'm trying to input.

20
01/02/2009 22.46
01/05/2009 22.39
01/06/2009 22.62
01/07/2009 21.94
01/08/2009 22.05
01/09/2009 21.55
01/12/2009 21.03
01/13/2009 21.10
01/14/2009 20.37
01/15/2009 20.46
01/16/2009 20.63
01/20/2009 19.50
01/21/2009 20.36
01/22/2009 20.01
01/23/2009 20.12
01/26/2009 20.24
01/27/2009 20.46
01/28/2009 21.17
01/29/2009 20.45
01/30/2009 20.00
Topic archived. No new replies allowed.