Sie sind auf Seite 1von 1

#include<iostream> #include<stdlib.

h> using namespace std; int main() { system("cls"); int h4t1,m4t1,s4t1,h4t2,m4t2,s4t2,rh,rm,rs; system ("color 2E"); cout << "Enter Hours Minutes and Seconds for Time 1 : "; cin >> h4t1 >> m4t1 >> s4t1; cout << "Enter Hours Minutes and Seconds for Time 2 : "; cin >> h4t2 >> m4t2 >> s4t2; if ( h4t1 || h4t2 || m4t1 || m4t2 || s4t1 || s4t2 == NULL ) { cout << "\n\nYou entered an invalid Number.\n\n"; system("pause" ); exit(1); } rh=h4t1+h4t2; rm=m4t1+m4t2; rs=s4t1+s4t2; int days,newh,newm,news,mm,mh; mm=rs/60; /** add to rm ie 65/60=1minute */ g seconds print on screen */ rm+=mm; mh=rm/60; /** add to rh ie 65/60=1 hour g minutes print on screen */ rh+=mh; days=rh/24; newh=rh%24; cout << "\n\nTotal Time : \n" << days << " Days\n" << newh << " = Hours\ n" << newm << " = Minutes\n" << news << " = Seconds.\n\n"; system("pause"); return 0; } news=rs%60; /** Remainin

*/ newm=rm%60; /** Remainin

Das könnte Ihnen auch gefallen