Advertisement
Guest User

11677

a guest
Dec 11th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. int h1,h2,m,a,m1,m2;
  4. scanf("%d%d%d%d",&h1,&m1,&h2,&m2);
  5. while(h1!=0||h2!=0||m1!=0||m2!=0){
  6. if (h1==0)
  7. a=h2*60-m1+m2;
  8. else if(h2==0)
  9. a=(24-h1)*60-m1+m2;
  10. else if(h1==h2)
  11. a=24*60-m1+m2;
  12. else if(h1<h2)
  13. a=(h2-h1)*60-m1+m2;
  14. else
  15. a=(24-(h1-h2))*60-m1+m2;
  16. printf("%d\n",a);
  17. scanf("%d%d%d%d",&h1,&m1,&h2,&m2);
  18. }
  19. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement