直角坐标系
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
X是一个喜欢数学的小孩,现在他刚刚学了坐标系。他想知道点(X,Y)在第几象限内。输入数据保证点不在坐标轴及原点上。
Input
多组输入。
每组输入两个整数X,Y,代表点(X,Y),中间用空格隔开。
Output
输出一个整数代表点在第几象限内。
Example Input
2 3 -2 -3
Example Output
1 3#include <stdio.h> #include <stdlib.h> int main() { int a,b,c; while(scanf("%d %d",&a,&b)!=EOF){ if(a>0&&b>0){printf("1\n");} else if(a>0&&b<0){printf("4\n");} else if(a<0&&b>0){printf("2\n");} else{printf("3\n");} } return 0; }
1424

被折叠的 条评论
为什么被折叠?



