Advertisement
Spocoman

Tennis Equipment

Sep 22nd, 2023
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double racketPrice;
  8.     cin >> racketPrice;
  9.  
  10.     int racketCount, sneakersCount;
  11.     cin >> racketCount >> sneakersCount;
  12.  
  13.     double racketsSum = racketPrice * racketCount;
  14.     double sneackersSum = racketPrice / 6 * sneakersCount;
  15.     double price = (racketsSum + sneackersSum) * 1.2;
  16.  
  17.     cout << "Price to be paid by Djokovic " << floor(price / 8) << endl;
  18.     cout << "Price to be paid by sponsors " << ceil(price * 7 / 8) << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement