Advertisement
MaksNew

Untitled

Feb 15th, 2021
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. bool isFileCorrect(string path)
  2. {
  3.     string inputline;
  4.     regex regular("\\d\\s*");
  5.     fstream fin(path, std::ios_base::in);
  6.     bool isCorrect = true;
  7.     while (!fin.eof() && isCorrect)
  8.     {
  9.         getline(fin, inputline);
  10.         if (!(regex_match(inputline.c_str(), regular)))
  11.             isCorrect = false;
  12.     }
  13.     fin.close();
  14.     return isCorrect;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement