fork download
  1. #include <fstream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ifstream file("file.txt",ios::in);
  8. if (file.good())
  9. {
  10. string str;
  11. while(getline(file, str))
  12. {
  13. istringstream ss(str);
  14. int num;
  15. while(ss >> num)
  16. {
  17. // ...
  18. }
  19. }
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Standard output is empty