summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog2/Prakt3/Aufg1/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Bachelor/Prog2/Prakt3/Aufg1/main.cpp')
-rw-r--r--Bachelor/Prog2/Prakt3/Aufg1/main.cpp50
1 files changed, 50 insertions, 0 deletions
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 <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;
+}