Advertisement
Spocoman

Maiden Party

Sep 20th, 2023
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double partyPrice;
  7.     cin >> partyPrice;
  8.  
  9.     int loveMessageCount, waxRoseCount, keychainCount, caricatureCount, luckySurpriseCount;
  10.     cin >> loveMessageCount >> waxRoseCount >> keychainCount >> caricatureCount >> luckySurpriseCount;
  11.  
  12.     int totalCount = loveMessageCount + waxRoseCount + keychainCount + caricatureCount + luckySurpriseCount;
  13.  
  14.     double budget = 0.60 * loveMessageCount + 7.20 * waxRoseCount + 3.60 * keychainCount + 18.20 * caricatureCount + 22.00 * luckySurpriseCount;
  15.  
  16.     if (totalCount >= 25) {
  17.         budget *= 0.65;
  18.     }
  19.  
  20.     budget = budget * 0.9 - partyPrice;
  21.  
  22.     cout.setf(ios::fixed);
  23.     cout.precision(2);
  24.  
  25.     if (budget >= 0) {
  26.         cout << "Yes! " << budget << " lv left.\n";
  27.     }
  28.     else {
  29.         cout << "Not enough money! " << abs(budget) << " lv needed.\n";
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement