Advertisement
teknique

Untitled

Oct 25th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ifstream inputFile;
  9. int sum = 0;
  10. int score = 0;
  11.  
  12. inputFile.open("testas.txt");
  13. cout << "Reading information from the file.\n";
  14. while(inputFile >> score);
  15. {
  16. sum = sum + score;
  17. }
  18. cout << sum;
  19. return 0;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement