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")