Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string input;
- cin >> input;
- double sum = 0;
- while (input != "NoMoreMoney") {
- double money = stod(input);
- if (money < 0) {
- cout << "Invalid operation!\n";
- break;
- }
- printf("Increase: %.2f\n", money);
- sum += money;
- cin >> input;
- }
- printf("Total: %.2f\n", sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement