Written By : MathModel
We've the quaraters enumeration as above , so we casework with noting that the answer is if any of the following holds:
x=0
y=0
The main condition is :
For quarter 1 : x>0 and y>0
For quarter 2 : x<0 and y>0
For quarater 3 : x<0 and y<0
For quarter 4 : x>0 and y<0
Make sure to read as float/double numbers.
x,y=map(float,input().split())
if(x>0 and y>0):
print(1)
elif(x>0 and y<0):
print(4)
elif(x<0 and y>0):
print(2)
elif(x<0 and y<0):
print(3)
else:
print(0)Complexity .