Subscribe Us

Responsive Advertisement

Advertisement

URI Online Judge | 1103 Alarm Clock solution in c

 

uri 1103 solution in c

by ujjal roy



#include<stdio.h>


main()

{

while(1)

{

    int h1,m1,h2,m2,r1,r2;


   scanf("%d%d%d%d",&h1,&m1,&h2,&m2);

   if(h1==0&&h2==0&&m2==0&&m1==0) break;

   if(h1==0) r1=h1*60+m1;

    else r1=h1*60+m1;

    if(h2==0) r2=h2*60+m2;

    else r2=h2*60+m2;

    if(r2>r1)

    printf("%d\n",r2-r1);

    else

        printf("%d\n",1440-(r1-r2));

}

    return 0;

}


Post a Comment

0 Comments