Advertisement
Spocoman

Pool Day

Sep 21st, 2023
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int people;
  9.     cin >> people;
  10.  
  11.     double entrancePrice, deskChairPrice, umbrellaPrice;
  12.     cin >> entrancePrice >> deskChairPrice >> umbrellaPrice;
  13.  
  14.     double total = entrancePrice * people + deskChairPrice * ceil(0.75 * people) + umbrellaPrice * ceil(0.5 * people);
  15.  
  16.     printf("%.2f lv.\n", total);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement