blob: e8a47ccdc7c3c134762caa226df55a71b0e8f62c (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
|
#include "Team.h"
#include "Table.h"
#include <iostream>
#include <vector>
#include <string>
#include <new>
#include <fstream>
#include <iomanip>
using std::cout;
using std::cerr;
using std::string;
using std::ifstream;
using std::ofstream;
using std::ios;
using std::endl;
using std::setw;
using std::left;
using std::ostream;
int main()
{
int n=0;
Team team;
Table tab;
ifstream inDTA("tabletennis.dta",ios::binary);
if ( !inDTA ) {
cerr << "File could not be opened." << endl;
exit( 1 );
} // end if
while(team.read(inDTA))
{
tab.setTeam(team);
}
inDTA.close();
tab.print(cout);
tab.sort();
tab.print(cout);
ofstream outF("tabletennis.txt",ios::out);
tab.print(outF);
outF.close();
return 0;
}
|