Untitled
unknown
plain_text
2 years ago
299 B
10
Indexable
// 0; 0.
#include <iostream>
using namespace std;
int main() {
bool sz = false;
int f;
int e = 0;
while (1) {
cin >> f;
e += f;
if (f == 0 && sz == 1) {
break;
}
if (f == 0 && sz == 0) {
sz = 1;
}
if (f != 0) {
sz = 0;
}
}
cout << e;
return 0;
}Editor is loading...