Advertisement
Spocoman

05. Godzilla vs. Kong

Sep 1st, 2023 (edited)
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double budget;
  7.     cin >> budget;
  8.  
  9.     int statist;
  10.     cin >> statist;
  11.  
  12.     double dress;
  13.     cin >> dress;
  14.  
  15.     double decor = budget / 10;
  16.  
  17.     if (statist > 150) {
  18.         dress *= 0.9;
  19.     }
  20.  
  21.     double price = decor + statist * dress;
  22.  
  23.     cout.setf(ios::fixed);
  24.     cout.precision(2);
  25.  
  26.     if (budget >= price) {
  27.         cout << "Action!" << endl;
  28.         cout << "Wingard starts filming with " << budget - price << " leva left." << endl;
  29.     }
  30.     else {
  31.         cout << "Not enough money!" << endl;
  32.         cout << "Wingard needs " << price - budget << " leva more." << endl;
  33.     }
  34.    
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement