#include
using namespace std;
int main(){
int a, sum;
sum = 0; a = 1;
while (a != 0){
cin >> a;
sum = sum + a;
}
cout << "Сумма = " << sum << endl;<br>}
-------------------------------------
Пример:
-------------------------------------
-5
5
4
-2
0
Сумма = 2