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 total = 0;
- while (input != "NoMoreMoney") {
- double cash = stod(input);
- if (cash < 0) {
- cout << "Invalid operation!\n";
- break;
- }
- printf("Increase: %.2f\n", cash);
- total += cash;
- cin >> input;
- }
- printf("Total: %.2f\n", total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement