Advertisement
wigllytest

Untitled

Aug 7th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9. string typeYear;
  10. int p, h;
  11. cin >> typeYear >> p >> h;
  12.  
  13. double weekends = (48 - h) * 3.0 / 4;
  14. //cout << weekends << endl;
  15. double hollydays = p * 2.0 / 3;
  16. //cout << hollydays << endl;;
  17. double allPlays = weekends + hollydays + h;
  18. //cout << allPlays << endl;;
  19.  
  20. if (typeYear == "leap")
  21. {
  22. allPlays *= 1.15;
  23. }
  24. else
  25. {
  26. allPlays = allPlays;
  27. }
  28.  
  29. cout << floor(allPlays);
  30.  
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement