Beecrowd 1041 Coordinates of a Point Solution in C , C++, Python || Beecrowd 1041 Solution

Beecrowd 1041 Solution – Coordinates of a Point

Question

Solution in C

#include<stdio.h>

int main() {
double x,y;
scanf("%lf%lf",&x,&y);

if(x==0 && y==0){
printf("Origem\n");
}
else if(x==0){
printf("Eixo Y\n");
}
else if(y==0){
printf("Eixo X\n");
}
else if(x>0&&y>0){
printf("Q1\n");
}
else if(x<0&&y>0){
printf("Q2\n");
}
else if(x<0&&y<0){ printf("Q3\n"); } else if(x>0&&y<0){
printf("Q4\n");
}
return 0;
}

Beecrowd 1041 Solution- Coordinates of a Point Solution in Python

x, y = map(float, input().split())

if x == 0 and y == 0:
    print("Origem")
elif x == 0:
    print("Eixo Y")
elif y == 0:
    print("Eixo X")
elif x > 0 and y > 0:
    print("Q1")
elif x < 0 and y > 0:
    print("Q2")
elif x < 0 and y < 0:
    print("Q3")
elif x > 0 and y < 0:
    print("Q4")

Next problem: Beecrowd -1042 Simple Sort Solution 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck