problems with orders

the numbers that i have for my output dont line up. For example ill run the code and it will give me
11245...158
14652...89
19832...373
20014...243
but i need the right columns to be moved up one row so its
11245...89
14652...373
19832...243
20014...200
any ideas?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <fstream>
using namespace std;

void main()
{
	ifstream fin;
	int id, score, baseid,sum=0,min,max,count=0;

	fin.open("\\Users\\owen\\Desktop\\Quizzes.dat");
	fin>>id>>score;
	baseid=id;
	sum=score;
	max=score;
	min=score;
	fin>>id>>score;
	while(!fin.eof())
	{
		if(id==baseid)
		{
			sum=sum+score;
			count=count+1;
			if(min>score)
				min=score;
					if(max<score)
						max=score;
		}
		if(id!=baseid)
		{
			cout<<id<<" " <<sum-max-min<<endl;
			baseid=id;
			sum=score;
			max=score;
			min=score;
		}
		fin>>id>>score;
	}

}
Please do not double post. YOu are cluttering the forum.
Other thread: http://www.cplusplus.com/forum/beginner/125278/
sorry didnt know what category to put this under and i need help.
Topic archived. No new replies allowed.