Advertisement
Mlie

10-19-P1

Sep 4th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. /* Yeungnam University College in Korea
  7. http://secure.ync.ac.kr/ */
  8.  
  9. int main()
  10. {
  11.     int a, b, c;
  12.  
  13.     ifstream inStream;
  14.     inStream.open("input.txt");
  15.  
  16.     ofstream outStream;
  17.     outStream.open("output.txt");
  18.  
  19.     inStream >> a >> b;
  20.  
  21.     c = a + b ;
  22.  
  23.     outStream << a << " and " << b << " add up to " << c << ".";
  24.  
  25.     inStream.close();
  26.     outStream.close();
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement