Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include "factor.h"
  4.  
  5. using namespace std;
  6.  
  7. void in_thread(string& in_file, string& out_file, factor& A)
  8. {
  9.     ifstream fin(in_file);
  10.     ofstream fout(out_file);
  11.     uint64_t current;
  12.  
  13.     while (!fin.eof())
  14.     {
  15.         fin >> current;
  16.         A.createFactor(current);
  17.         fout << A.getString() << std::endl;
  18.     }
  19. }
  20.  
  21. int main()
  22. {
  23.     factor A;
  24.     string in_file, out_file;
  25.  
  26.     cout << "Input file: " << std::endl;
  27.     cin >> in_file;
  28.     cout << "Output file: " << std::endl;
  29.     cin >> out_file;
  30.  
  31.     thread func_thread(in_thread, in_file, out_file, A);
  32.     if (func_thread.joinable())
  33.         func_thread.join();
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement