Horje
input n space separated integers in c++ Code Example
input n space separated integers in c++
int main() {
int sum = 0;
cout << "enter number" << endl;
int i = 0;
while (true) {
    cin >> i;
    sum += i;
    //cout << i << endl;
    if (cin.peek() == '\n') {
        break;
    }
    
}

cout << "result: " << sum << endl;
return 0;
}




Cpp

Related
how to download c++ portable compiler Code Example how to download c++ portable compiler Code Example
matplotlib hide numbers on axis Code Example matplotlib hide numbers on axis Code Example
vector of vectors of pairs c++ Code Example vector of vectors of pairs c++ Code Example
pointers in c++ Code Example pointers in c++ Code Example
move elements from vector to unordered_set Code Example move elements from vector to unordered_set Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7