Friday, October 26, 2018

Uri 1115 solution in C | Quadrant

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/


#include<stdio.h>
main()
{
    int m,n;
    while(1)
    {
        scanf("%d%d",&m,&n);
        if(m==0||n==0)
            break;
        else if(m>0&&n>0)
        {
            printf("primeiro\n");
        }
        else if(m>0&&n<0)
        {
            printf("quarto\n");
        }
        else if(m<0&&n>0)
        {
            printf("segundo\n");
        }
        else if(m<0&&n<0)
        {
            printf("terceiro\n");
        }
    }
    return 0;
}


 //Happy_Coding

No comments:

Post a Comment