From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog2/Prakt3/Aufg1/main.cpp | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Bachelor/Prog2/Prakt3/Aufg1/main.cpp (limited to 'Bachelor/Prog2/Prakt3/Aufg1/main.cpp') diff --git a/Bachelor/Prog2/Prakt3/Aufg1/main.cpp b/Bachelor/Prog2/Prakt3/Aufg1/main.cpp new file mode 100644 index 0000000..e8a47cc --- /dev/null +++ b/Bachelor/Prog2/Prakt3/Aufg1/main.cpp @@ -0,0 +1,50 @@ +#include "Team.h" +#include "Table.h" +#include +#include +#include +#include +#include +#include + +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; +} -- cgit v1.2.3