1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#include <iostream> using namespace std; int main() { int h1,h2,m1,m2; int a,b; while(cin>>h1) { cin>>m1>>h2>>m2; if(h1+h2+m1+m2==0) break; a = h1*60+m1; b = h2*60+m2; if(b<a) { cout<<(24*60)-a+b<<"\n"; } else { cout<<b-a<<"\n"; } } return 0; } |