Advertisement
Guest User

Untitled

a guest
Mar 7th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<string>
  4. #include<algorithm>
  5. #include<cstdio>
  6. #include<cstring>
  7. #include<vector>
  8. #include<stack>
  9. #include<queue>
  10. #include<map>
  11. #define FRO freopen("in.txt","r",stdin)
  12.  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17. //FRO;
  18. int a,b,c,i,j,k,tc,t=0;
  19. int n,m,cnt=0,h,h1,m1,cnt1;
  20. while(scanf("%d%d%d%d",&h,&m,&h1,&m1))
  21. {
  22. if(h==m&& m==h1&& h1==m1&& m1==0)return 0;
  23. //if(t>0){printf("\n");t++;}
  24. cnt=0;cnt1=0;
  25. if(m1>=m)cnt+=m1-m;
  26. else {cnt+=m1+(60-m);}
  27. if(h==h1)
  28. {
  29. if(m>m1)cnt1+=h1+(23-h);
  30. }
  31. else if(h>h1)
  32. {
  33. cnt1+=h1+(23-h);
  34. }
  35. else cnt1+=h1-h;
  36. printf("%d\n",cnt+(cnt1*60));
  37. }
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement