#include <iostream>
using namespace std;
int main()
{
struct timp
{ int h, m, s;};
int i,Sh=0,Sm=0,Ss=0;
timp t1,t2;
timp t[30];
for(i=1; i<=2; i++)
{cout<<"ora este =";cin>>t[i].h;
cout<<"minutele sunt=";cin>>t[i].m;
cout<<"secundele sunt=";cin>>t[i].s;
}
for(i=1; i<=2; i++)
Ss=Ss+t[i].s;
if(Ss>60)
Sm=Sm+t[i].m;
if(Sm>60)
Sh=Sh+1;
Sh=Sh+t[i].h;
if(Sh>24)
cout<<"a mai trecut o zi";
cout<<"suma celor doua momente este="<<Sh<<"ore"<<Sm<<"minute"<<Ss<<"secunde";
return 0;
}
Niciun comentariu:
Trimiteți un comentariu