Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main(){
  5. double firstBro, secondBro, thirdBro, father;
  6. cin>> firstBro>>secondBro>>thirdBro>> father;
  7. double totalTime= 1/(1/firstBro+1/secondBro+1/thirdBro);
  8. double Break=totalTime*0.15;
  9. double allTime= Break+ totalTime;
  10. cout.setf(ios::fixed);
  11. cout.precision(2);
  12. cout<<"Cleaning time: " <<allTime<<endl;
  13. double finalTime= father-allTime;
  14. if (finalTime>0){
  15.  
  16. cout<< "Yes, there is a surprise - time left -> "<<floor(finalTime)<< " hours."<<endl;
  17. }else if (finalTime<0){
  18. cout<<"No, there isn't a surprise - shortage of time -> "<< ceil(abs(finalTime))<<" hours."<<endl;
  19.  
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement