Advertisement
wigllytest

Untitled

Aug 23rd, 2020
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. double racketPrice;
  9. int racketCount, sneakersCount;
  10. cin >> racketPrice >> racketCount >> sneakersCount;
  11.  
  12.  
  13. double totalRacketPrice = racketCount * racketPrice;
  14. double sneakerPrice = racketPrice / 6;
  15. double totalSneakersPrice = sneakerPrice * sneakersCount;
  16. double otherEquipment = 0.2 * (totalRacketPrice + totalSneakersPrice);
  17. double allEquipment = otherEquipment + totalRacketPrice + totalSneakersPrice;
  18. double priceDjoko = floor (allEquipment / 8);
  19. double priceSponsor = ceil (allEquipment * 7 / 8);
  20.  
  21. cout.setf(ios::fixed);
  22. cout.precision(0);
  23.  
  24. cout << "Price to be paid by Djokovic " << priceDjoko << endl;
  25. cout << "Price to be paid by sponsors " << priceSponsor;
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement