Advertisement
DidiMilikina

12. Volleyball

Oct 1st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9.     string year;
  10.     double holiday, home_weekend;
  11.     cin >> year >> holiday >> home_weekend;
  12.     double sofia_weekend = 48 - home_weekend;
  13.     double sofia_play = sofia_weekend * 3 / 4;
  14.     double holiday_play = holiday * 2 / 3;
  15.     double play = sofia_play + holiday_play + home_weekend;
  16.  
  17.     if (year == "normal")
  18.     {
  19.         cout << floor(play) << endl;
  20.     }
  21.     else
  22.     {
  23.         cout << floor(play * 1.15) << endl;
  24.     }
  25.  
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement