Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<vector>
- using namespace std;
- vector<vector<string>> data(31);
- int mi = 0;
- const vector<int> month = { 31,28,31,30,31,30,31,31,30,31,30,31 };
- void dump(const vector<vector<string>>& data, const int& day) {
- for (auto s : data[day - 1]) {
- cout << s << ' ';
- }
- }
- void add(vector<vector<string>>& data) {
- int day;
- string work;
- cin >> day >> work;
- data[day - 1].push_back(work);
- }
- void next(vector<vector<string>>& data, const vector<int>& month, int& mi) {
- if (mi == 11) {
- mi = 0;
- }
- else if (mi != 11) {
- ++mi;
- }
- if (month[mi] >= month[mi - 1]) {
- data.resize(month[mi]);
- }
- else {
- vector<string> temp;
- int diff = month[mi - 1] - month[mi];
- for (int i = 0; i < diff; ++i) {
- for (auto& s : data[month[mi] - 1 - i]) {
- temp.push_back(s);
- }
- }
- for (auto s : temp) {
- cout << s << ' ';
- }
- }
- }
- int main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement