Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.  
  9. string line;
  10. long a, b;
  11. ifstream myfile ("sum.in");
  12. if (myfile.is_open())
  13. {
  14. myfile >> a >> b;
  15. long c = a + b;
  16.  
  17. ofstream myfile2("sum.out");
  18. myfile2 << c;
  19. myfile2.close();
  20.  
  21. myfile.close();
  22. }
  23.  
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement