You are viewing a single comment's thread. Return to all comments →
for variable number of inputs
#include <iostream> using namespace std; int main() { int i = 0; int sum = 0; while (cin >> i) { sum += i; } cout << sum << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Input and Output
You are viewing a single comment's thread. Return to all comments →
for variable number of inputs