Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int countPeople;
- cin >> countPeople;
- double entryPrice, loungePrice, umbrellaPrice;
- cin >> entryPrice >> loungePrice >> umbrellaPrice;
- //парти -> вход, шезлонг, чадър
- //1. обща цена за вход на всички
- double totalEntrySum = countPeople * entryPrice;
- //2. обща цена за шезлонгите
- double totalLoungePrice = ceil(0.75 * countPeople) * loungePrice;
- //3. обща цена за чадърите
- double totalUmrellaPrice = ceil(0.50 * countPeople) * umbrellaPrice;
- //4. крайна цена за партито = сума за вход + сума за шезлонги + сума за чадъри
- double finalPrice = totalEntrySum + totalLoungePrice + totalUmrellaPrice;
- cout.setf(ios::fixed);
- cout.precision(2);
- cout << finalPrice << " lv.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement