#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0)
using namespace std;
int main()
{
FAST;
int h1, m1, h2, m2;
while(cin>>h1>>m1>>h2>>m2 ){
if(!h1 && !m1 && !h2 && !m2)break;
int start = h1*60 + m1;
int ending = h2*60 + m2;
if(start < ending)cout<<ending - start<<'\n';
else if(start == ending )cout<<0<<'\n';
else cout<<(24*60) - start + ending<<'\n';
}
return 0;
}
#define FAST ios_base::sync_with_stdio(0)
using namespace std;
int main()
{
FAST;
int h1, m1, h2, m2;
while(cin>>h1>>m1>>h2>>m2 ){
if(!h1 && !m1 && !h2 && !m2)break;
int start = h1*60 + m1;
int ending = h2*60 + m2;
if(start < ending)cout<<ending - start<<'\n';
else if(start == ending )cout<<0<<'\n';
else cout<<(24*60) - start + ending<<'\n';
}
return 0;
}
No comments:
Post a Comment