Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- #include<string>
- #include<algorithm>
- #include<cstdio>
- #include<cstring>
- #include<vector>
- #include<stack>
- #include<queue>
- #include<map>
- #define FRO freopen("in.txt","r",stdin)
- using namespace std;
- int main()
- {
- //FRO;
- int a,b,c,i,j,k,tc,t=0;
- int n,m,cnt=0,h,h1,m1,cnt1;
- while(scanf("%d%d%d%d",&h,&m,&h1,&m1))
- {
- if(h==m&& m==h1&& h1==m1&& m1==0)return 0;
- //if(t>0){printf("\n");t++;}
- cnt=0;cnt1=0;
- if(m1>=m)cnt+=m1-m;
- else {cnt+=m1+(60-m);}
- if(h==h1)
- {
- if(m>m1)cnt1+=h1+(23-h);
- }
- else if(h>h1)
- {
- cnt1+=h1+(23-h);
- }
- else cnt1+=h1-h;
- printf("%d\n",cnt+(cnt1*60));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement