Advertisement
Dani_info

interval de timp_dani

Oct 15th, 2017
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int h1, h2, ht, m1, m2, mt, s1, s2, st;
  8. cout<<"Inttrroduceti primul interval de timp(ora, minut, secunda)"<<endl;
  9. cin>>h1>>m1>>s1;
  10. cout<<"Inttrroduceti al doila interval de timp(ora, minut, secunda)";
  11. cin>>h2>>m2>>s2;
  12. st=s1+s2;
  13. mt=m1+m2+st/60;
  14. st=st%60;
  15. ht=h1+h2+mt/60;
  16. mt=mt%60;
  17.  
  18. cout<<"Intervalul de timp este:"<<ht<<"ore, "<<mt<<"minute, "<<st<<"secunde";
  19. return 0;
Advertisement
RAW Paste Data Copied
Advertisement