Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- using namespace std;
- int main()
- {
- double first_brother_cleaning;
- double second_brother_cleaning;
- double third_brother_cleaning;
- double father_fisihng;
- cin >> first_brother_cleaning >> second_brother_cleaning >> third_brother_cleaning
- >> father_fisihng;
- double total_time = 1 / (1 / first_brother_cleaning + 1 / second_brother_cleaning
- + 1 / third_brother_cleaning);
- double time_with_relax = total_time * 1.15;
- double left_hours = father_fisihng - time_with_relax;
- cout << "Cleaning time: " << fixed << setprecision(2) << time_with_relax << endl;
- if (time_with_relax < father_fisihng)
- {
- cout << "Yes, there is a surprise - time left -> " << fixed << setprecision(0)
- <<floor(left_hours) << " hours." << endl;
- }
- else
- {
- cout << "No, there isn't a surprise - shortage of time -> "
- << fixed << setprecision(0) << ceil(abs(left_hours)) <<" hours." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement