Created
October 27, 2017 14:46
-
-
Save anden3/46e7e85d02ca0ac1bd97f895b3290947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fstream> | |
| using namespace std; | |
| int main() { | |
| ifstream input1("input1.txt"); // in fstream, läser ett textdokument | |
| ifstream input2("input2.txt"); | |
| ofstream output("output.txt"); // out fstream, skapar och öppnar ett textdokument | |
| while (!(input1.eof() || input2.eof())) { | |
| int a, b; | |
| input1 >> a; | |
| input2 >> b; | |
| output << a + b << endl; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment