Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- кажете къде е грешката C++
- #include <iostream>
- using namespace std;
- int main()
- {
- double budget, suitPrice;
- int peopleCount;
- cin >> budget;
- cin >> peopleCount;
- cin >> suitPrice;
- double decorPrice = budget * 0.1;
- double suitTotalPrice = peopleCount * suitPrice;
- if (peopleCount > 150)
- {
- //suitTotalPrice = suitTotalPrice * 0.1;
- suitTotalPrice *= 0.9;
- }
- double totalPrice = decorPrice + suitTotalPrice;
- cout.setf(ios::fixed);
- cout.precision(2);
- if (budget >= totalPrice)
- {
- cout << "Action!" << endl;
- cout << "Wingard starts filming with " << budget - totalPrice << " leva left.";
- }
- else
- {
- cout << "Not enough money!" << endl;
- cout << "Wingard needs " << totalPrice - budget << " leva more.";
- }
- cout << totalPrice;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement