Wednesday 8 June 2016

Solution of URI 2057 :: Time Zone


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 s, t, f, ans;
    scanf("%d%d%d", &s, &t, &f);
    ans = s+t+f;
    if(ans < 0) ans = 24 + ans;
    printf("%d\n",ans%24);
    return 0;
}

1 comment:

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