fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int h1,h2,m1,m2,s1,s2,q,y,pay;
  7. cout<< "enter the first work duration";
  8. cin >> h1>>m1>>s1 ;
  9. cout<< "enter the second work duration";
  10. cin >> h2>>m2>>s2 ;
  11. q=s1+s2;
  12. q=q/60 ;
  13. y= (h1+h2)*60+s1+s2+m1+m2;
  14. if (y>540)
  15. {
  16. pay=1.5*540+(y%540)*2.5;}
  17. cout << pay;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3464KB
stdin
1 12 55
1 11 23
stdout
enter the first work durationenter the second work duration-145281024