Advertisement
allia

часы1

Feb 8th, 2021 (edited)
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <regex>
  3. #include <iterator>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string str;
  10.  
  11.     regex fit(R"(([0-1][0-9]|2[0-3]):[0-5][0-9])");
  12.    
  13.    
  14.     while (getline(cin, str))
  15.     {
  16.         regex_iterator<string::iterator> rit(str.begin(), str.end(), fit);
  17.         regex_iterator<string::iterator> rend;
  18.  
  19.         while (rit != rend)
  20.         {
  21.             cout << rit->str() << endl;
  22.             ++rit;
  23.         }
  24.     }
  25.        
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement