Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <regex>
- using namespace std;
- int main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- string stroke;
- regex regular(
- "([0-1]?[0-9]:[0-5][0-9]([\\s][a|p][m])?)|([2][0-3]:[0-5][0-9]([\\s][a|p][m])?)"
- );
- smatch m;
- while (getline(cin, stroke)) {
- while (regex_search(stroke, m, regular)) {
- cout << m[0] << endl;
- stroke = m.suffix().str();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement