Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main()
- {
- string typeOfYear;
- int holidays, hometownWeekends;
- double totalPlays;
- string mystr;
- getline(cin, mystr);
- stringstream(mystr) >> typeOfYear;
- getline(cin, mystr);
- stringstream(mystr) >> holidays;
- getline(cin, mystr);
- stringstream(mystr) >> hometownWeekends;
- double normalPlays = (52 - hometownWeekends) * 2.0 / 3;
- totalPlays = hometownWeekends;
- totalPlays += normalPlays;
- totalPlays += holidays / 2.0;
- if (typeOfYear == "t")
- {
- totalPlays += 3;
- }
- int result = (int)totalPlays;
- cout << result;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement