Created
December 17, 2014 15:45
-
-
Save sicknarlo/e2322ce70f198b5f49d8 to your computer and use it in GitHub Desktop.
[CodeEval] Sum of Integers From File
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
//Print out the sum of integers read from a file. | |
#include<iostream> | |
using namespace std; | |
int main(){ | |
int sum = 0, n; | |
while (cin >> n){ | |
sum += n; | |
} | |
cout << sum; | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment