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