Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- #include <iomanip>
- #include <math.h>
- #include <cmath>
- int main()
- {
- double budget;
- int statists;
- double price;
- do
- {
- cin.clear();
- cin >> budget;
- } while (cin.bad() || budget < 1 || budget> 1000000);
- do
- {
- cin.clear();
- cin >> statists;
- } while (cin.bad() || statists < 1 || statists> 500);
- do
- {
- cin.clear();
- cin >> price;
- } while (cin.bad() || price < 1 || price> 1000);
- double decor = budget * 0.1;
- double dressprice = price*statists;
- if (statists >= 150)
- {
- dressprice = (price * statists) * 0.9;
- }
- if (budget < (decor + dressprice))
- {
- cout << "Not enough money!" << endl;
- cout << fixed << setprecision(2) << "Wingard needs " << (decor+dressprice-budget) <<" leva more." << endl;
- }
- if (budget >= (decor + dressprice))
- {
- cout << "Action!" << endl;
- cout << fixed << setprecision(2) << "Wingard starts filming with " << (budget - decor - dressprice) << " leva left." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement