Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double firstTime, secondTime, thirdTime, fatherTime;
- cin >> firstTime >> secondTime >> thirdTime >> fatherTime;
- double cleaningTime = 1 / (1 / firstTime + 1 / secondTime + 1 / thirdTime) * 1.15;
- printf("Cleaning time: %.2f\n", cleaningTime);
- if (fatherTime > cleaningTime) {
- printf("Yes, there is a surprise - time left -> %.0f hours.\n", floor(fatherTime - cleaningTime));
- }
- else {
- printf("No, there isn't a surprise - shortage of time -> %.0f hours.\n", ceil(cleaningTime - fatherTime));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement