A common problem in mathematics is to determine which quadrant a given point lies in. There are
four quadrants, numbered from 1 to 4, as shown in the diagram below:
For example, the point A, which is at coordinates (12, 5) lies in quadrant 1 since both its x and y values are positive, and point B lies in quadrant 2 since its x value is negative and its y value is positive.
Your job is to take a point and determine the quadrant it is in. You can assume that neither of the two coordinates will be 0.
在数学中,一个常见的问题是确定一个给定点位于哪个象限。有四个象限,编号从 1 到 4,如上图所示:
例如,点 A 的坐标为 (12, 5),位于第 1 象限,因为它的 x 和 y 值都是正的,而点 B 位于第 2 象限,因为它的 x 值是负的,而 y 值是正的。
你的任务是取一个点并确定它位于哪个象限。你可以假设两个坐标中没有一个是 0。