Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <string>
- #include <map>
- #include <set>
- #include <algorithm>
- #include <vector>
- #include <stdio.h>
- #include <cmath>
- #include <math.h>
- #include <queue>
- using namespace std;
- void add(string name)
- {
- for (int i = 1; i <= 10 - name.size(); i++)
- cout << " ";
- }
- int main()
- {
- map<string, map<int, vector<string>>>raspes;
- int n;
- cin >> n;
- string day, name;
- int par;
- vector <string> prom;
- prom.push_back("");
- for (int i = 1; i <= 4; i++)
- {
- raspes["Thursday"][i] = prom;
- raspes["Tuesday"][i] = prom;
- raspes["Saturday"][i] = prom;
- }
- for (int i = 1; i <= n; i++)
- {
- cin >> name;
- vector <string> k;
- string N;
- N = name;
- cin >> name;
- while (name != "Thursday"&&name != "Tuesday"&&name != "Saturday")
- {
- if (N.size() + name.size()+1 <= 10)
- N += " " + name;
- else
- {
- k.push_back(N);
- N = name;
- }
- cin >> name;
- }
- k.push_back(N);
- if (k.size() == 0)
- k.push_back("");
- day = name;
- cin >> par;
- raspes[day][par] = k;
- }
- for (int i = 1; i <= 4; i++)
- {
- cout << "+----------+----------+----------+" << endl;
- int Th = raspes["Thursday"][i].size() - 1, T = raspes["Tuesday"][i].size() - 1, S = raspes["Saturday"][i].size() - 1;
- int j = 0;
- while (j <= Th || j <= T || j <= S)
- {
- cout << "|";
- if (j <= T)
- {
- cout << raspes["Tuesday"][i][j];
- add(raspes["Tuesday"][i][j]);
- }
- else
- cout << " ";
- cout << "|";
- if (j <= Th)
- {
- cout << raspes["Thursday"][i][j];
- add(raspes["Thursday"][i][j]);
- }
- else
- cout << " ";
- cout << "|";
- if (j <= S)
- {
- cout << raspes["Saturday"][i][j];
- add(raspes["Saturday"][i][j]);
- }
- else
- cout << " ";
- cout << "|";
- cout << endl;
- j++;
- }
- }
- cout << "+----------+----------+----------+";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment