Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- //вход
- double budget;
- cin >> budget;
- int countStatists;
- cin >> countStatists;
- double pricePerStatist;
- cin >> pricePerStatist;
- //декор = 10% от бюджета
- double priceDecor = 0.1 * budget;
- //облекло = брой статистите * цена за 1 статист
- double priceClothes = countStatists * pricePerStatist;
- //!!отстъпка от крайната цена за облеклото -> брой > 150 -> обекло - 10%
- if (countStatists > 150) {
- priceClothes = priceClothes - priceClothes * 0.10;
- //priceClothes = priceClothes * 0.9
- //priceClothes *= 0.9
- }
- //сума за разходи = декор + облекло
- double sumExpenses = priceDecor + priceClothes;
- cout.setf(ios::fixed);
- cout.precision(2);
- //проверка дали бюджетът е достатъчен
- if (sumExpenses > budget) {
- //не ми стиггат парите
- cout << "Not enough money!" << endl;
- cout << "Wingard needs " << sumExpenses - budget << " leva more.";
- } else {
- cout << "Action!" << endl;
- cout << "Wingard starts filming with " << budget - sumExpenses << " leva left.";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment