SHARE
TWEET

Traveling C++

kolioi Jul 15th, 2018 166 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6.     while (true)
  7.     {
  8.         string destination;
  9.         cin >> destination;
  10.         if (!destination.compare("End"))
  11.             break;
  12.  
  13.         double expences;
  14.         cin >> expences;
  15.  
  16.         double savings = 0, money;
  17.         while (savings < expences)
  18.         {
  19.             cin >> money;
  20.             savings += money;
  21.         }
  22.  
  23.         cout << "Going to " << destination << "!\n";
  24.     }
  25.  
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top