Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- double firstBro, secondBro, thirdBro, father;
- cin>> firstBro>>secondBro>>thirdBro>> father;
- double totalTime= 1/(1/firstBro+1/secondBro+1/thirdBro);
- double Break=totalTime*0.15;
- double allTime= Break+ totalTime;
- cout.setf(ios::fixed);
- cout.precision(2);
- cout<<"Cleaning time: " <<allTime<<endl;
- double finalTime= father-allTime;
- if (finalTime>0){
- cout<< "Yes, there is a surprise - time left -> "<<floor(finalTime)<< " hours."<<endl;
- }else if (finalTime<0){
- cout<<"No, there isn't a surprise - shortage of time -> "<< ceil(abs(finalTime))<<" hours."<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement