diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Prog2/Prakt3/Aufg1/main.cpp | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Bachelor/Prog2/Prakt3/Aufg1/main.cpp')
| -rw-r--r-- | Bachelor/Prog2/Prakt3/Aufg1/main.cpp | 50 |
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;
+}
|
