Header Ads

Header ADS

Solution of URI 1115::Quadrant

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.




#include <stdio.h>

int main()
{
    int X,Y;

    while(scanf("%d%d",&X,&Y) !=EOF) {
        if(X==0 || Y==0) {
            return 0;
        }
        else if(X>0 && Y>0) {
            printf("primeiro\n");
        }
        else if(X<0 && Y<0) {
            printf("terceiro\n");
        }
        else if(X>0 && Y<0) {
            printf("quarto\n");
        }
        else if(X<0 && Y>0) {
            printf("segundo\n");
        }

    }

    return 0;
}

No comments

Theme images by konradlew. Powered by Blogger.