Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include<cmath>
- using namespace std;
- int main()
- {
- string serialName;
- getline(cin, serialName);
- int serialTime, breakTime;
- cin >> serialTime >> breakTime;
- double neededTime = breakTime / 8.0 + breakTime / 4.0 + serialTime;
- if (neededTime <= breakTime)
- {
- cout << "You have enough time to watch " << serialName << " and left with " << breakTime - floor(neededTime) << " minutes free time.\n";
- }
- else
- {
- cout << "You don't have enough time to watch " << serialName << ", you need " << ceil(neededTime) - breakTime<< " more minutes.\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement