uri 1103 solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
while(1)
{
int h1,m1,h2,m2,r1,r2;
cin>>h1>>m1>>h2>>m2;
if(h1==0&&h2==0&&m2==0&&m1==0) break;
if(h1==0) r1=h1*60+m1;
else r1=h1*60+m1;
if(h2==0) r2=h2*60+m2;
else r2=h2*60+m2;
if(r2>r1) cout<<r2-r1<<endl;
else cout<<1440-(r1-r2)<<endl;
}
return 0;
}
0 Comments