Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int h1,m1,h2,m2,h,m,ans;
- while(scanf("%d%d%d%d",&h1,&m1,&h2,&m2)==4)
- {
- if(h1==0&&m1==0&&h2==0&&m2==0)
- break;
- else
- {
- h=h2-h1;
- m=m2-m1;
- if(m<0)
- {
- m=m+60;
- h=h-1;
- }
- if(h<0)
- {
- h=h+24;
- }
- ans=(h*60)+m;
- }
- printf("%d\n",ans);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment