Advertisement
Filkolev

Joro The Football Player - C++ (working)

Oct 13th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string typeOfYear;
  8.     int holidays, hometownWeekends;
  9.     double totalPlays, normalPlays;
  10.     string mystr;
  11.  
  12.     cin >> typeOfYear;
  13.     cin >> holidays;
  14.     cin >> hometownWeekends;
  15.  
  16.     normalPlays = (52 - hometownWeekends) * 2.0 / 3;
  17.  
  18.     totalPlays = hometownWeekends;
  19.     totalPlays += normalPlays;
  20.     totalPlays += holidays / 2.0;
  21.  
  22.     if (typeOfYear == "t")
  23.     {
  24.         totalPlays += 3;
  25.     }
  26.  
  27.     int result = (int)totalPlays;
  28.  
  29.     cout << result;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement