Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <math.h>
- using namespace std;
- int main()
- {
- int countPeople;
- cin >> countPeople;
- double priceEnter, priceSunbed, priceUmbrella;
- cin >> priceEnter >> priceSunbed >> priceUmbrella;
- //обща сума = цена за входа + цена за шезлонги + цена за чадъри
- //цена за входа = бр. хората * цена за 1 човек вход
- //цена за шезлонгите = бр. шезлонгите * цена за 1 шезлонг
- //цена за чадъри = бр. чадърите * цена за 1 чадър
- double totalPriceEnter = countPeople * priceEnter;
- int countSunbeds = ceil(0.75 * countPeople);
- double totalPriceSunbeds = countSunbeds * priceSunbed;
- int countUmrellas = ceil(countPeople / 2.0);
- double totalPriceUmbrellas = countUmrellas * priceUmbrella;
- cout.setf(ios::fixed);
- cout.precision(2);
- double totalPrice = totalPriceEnter + totalPriceSunbeds + totalPriceUmbrellas;
- cout << totalPrice << " lv." << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment