Friday, 18 March 2016

Solution of URI 1115 :: Quadrant


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(1)
    {
        scanf("%d%d", &a, &b);
        if(a==0 || b==0)
            break;
        else if(a>0 && b>0)
            printf("primeiro\n");
        else if(a>0 && b<0)
            printf("quarto\n");
        else if(a<0 && b<0)
            printf("terceiro\n");
        else if(a<0 && b>0)
            printf("segundo\n");
    }
    return 0;
}

1 comment:

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