Thursday, 14 January 2016

Solution of URI 2003 :: Sunday Morning


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
int main()
{
    int a,b;
    while(scanf("%d:%d", &a, &b)!=EOF)
    {
        printf("Atraso maximo: ");
        if(a<7 || (a==7 && b==0)) printf("0\n");
        else printf("%d\n", ((a+1)-8)*60 + b);
    }
    return 0;
}

4 comments:

  1. Sir, the portion, how it will be expressed in C++?? "scanf("%d:%d", &a, &b)!=EOF"

    ReplyDelete
    Replies
    1. You can write the same line on c++. It will work.

      Delete
    2. Yeah. I have submitted it with this line. I just wanted to know if there is any syntax in c++,that's it.

      Delete

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