Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- main () {
- string command;
- double needed=0;
- double saved=0;
- cin>>command;
- while (command!="End"){
- cin>>needed;
- double income=0;
- while(needed>saved){
- cin>>income;
- saved+=income;
- }
- cout<<"Going to " << command<<"!" << endl;
- saved=0;
- cin>>command;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement