Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int bill;
- int sum = 0;
- do {
- cin >> bill;
- if (bill > 0) {
- cout << "Income: " << bill << endl;
- sum += bill;
- }
- // признаком конца программы будет счёт ноль
- } while (bill != 0);
- cout << "Total income: " << sum << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement