Friday, February 18, 2011

11677 - Alarm Clock


#include<stdio.h>

int main()
{
    register int h1,m1,h2,m2,m;
    //freopen("in.txt","r",stdin);

    while(scanf("%d%d%d%d",&h1,&m1,&h2,&m2)&&(h1||h2||m1||m2))
    {
        m1=m1+h1*60;
        m2=m2+h2*60;

        m=m2-m1;
        if(m<0)
            m=m+1440;

        printf("%d\n",m);
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.