Advertisement
Roboaudi

Untitled

Jan 24th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. кажете къде е грешката C++
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double budget, suitPrice;
  9. int peopleCount;
  10.  
  11. cin >> budget;
  12. cin >> peopleCount;
  13. cin >> suitPrice;
  14.  
  15. double decorPrice = budget * 0.1;
  16. double suitTotalPrice = peopleCount * suitPrice;
  17.  
  18. if (peopleCount > 150)
  19. {
  20. //suitTotalPrice = suitTotalPrice * 0.1;
  21. suitTotalPrice *= 0.9;
  22. }
  23.  
  24.  
  25. double totalPrice = decorPrice + suitTotalPrice;
  26.  
  27. cout.setf(ios::fixed);
  28. cout.precision(2);
  29.  
  30.  
  31.  
  32. if (budget >= totalPrice)
  33. {
  34. cout << "Action!" << endl;
  35. cout << "Wingard starts filming with " << budget - totalPrice << " leva left.";
  36. }
  37. else
  38. {
  39. cout << "Not enough money!" << endl;
  40. cout << "Wingard needs " << totalPrice - budget << " leva more.";
  41. }
  42.  
  43.  
  44. cout << totalPrice;
  45.  
  46.  
  47.  
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement