Ccf-20171203 Crontab problem,
Note the following points:
1. the start time and end time of the initial output, which does not include the end time.
2. The English representation of the month and week is case-insensitive, and it is not specified to be in the form of Sat.
3. the number on Sunday is 0.
My idea is to normalize the months, days, hours, minutes, and weeks in the following format:
Month: before normalization: 1, 2-4
After normalization: 1 2 3 4
Then use the stringstream class to traverse the normalized strings in sequence. In the process of traversing the month, we need to check whether the days match the month, and determine whether the day meets the requirements of the week.
Finally, determine whether the result is earlier than the deadline and greater than or equal to the start time.
The question and Code are as follows:
# Include <bits/stdc ++. h>/* # include <stdio. h> # include <iostream> # include <cstring> # include <stdlib. h >#include <sstream >#include <map> # include <vector> */using namespace std; class Time {public: int year, month, day, hour, minute; time (int year _, int month _, int day _, int hour _, int minute _): year (year _), month (month _), day (day _), hour (hour _), minute (minute _) {} void ShowTime () {cout <year <"," <month <", "<day <", "