trouble with arrangment

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;
	}

}
Try investigating where that 153 is coming from. It' very hard for us to help because we don't know the contents of that Quizzes.dat file.

By the way, in file paths prefer forward slashes over backward slashes - you don't have to escape them and all modern OSes accept forward slashes (even Windows).
10234 67
10234 100
10234 53
10234 91
11245 89
11245 46
11245 99
14652 100
14652 56
14652 99
14652 100
14652 96
14652 78
19832 92
19832 78
19832 51
19832 76
19832 89
20014 100
20014 100
20014 100
20014 100
21140 43
21140 56
21140 90
21140 78
21140 63
21140 67
21140 89
22256 10
22256 7
22256 7
22256 2
22256 11
22256 2
22256 2
22256 13
22256 9
27654 83
27654 83
27654 83
27654 83
30021 78
30021 67
30021 92
30021 59
30021 82
30021 58
this is what the quizzes.dat file looks like
Topic archived. No new replies allowed.