fork download
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. int main() {
  5. std::ifstream filestream("myfile.txt");
  6. double tot=0;
  7. double next;
  8. while(filestream >> next)
  9. tot += next;
  10. std::cout << tot;
  11. }
Success #stdin #stdout 0s 3064KB
stdin
Standard input is empty
stdout
Standard output is empty