http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2493 判断输入坐标在哪个方位,建立坐标系,关键是与 坐标原点比较
#include<stdio.h>
int main(){
int h,z,t,a,b;
while(scanf("%d",&t)!=EOF){
if(t==0)break;
scanf("%d%d",&a,&b);
while(t--){
scanf("%d%d",&h,&z);
if(h<a&&z>b) printf("NO\n");
else if(h>a&&z>b)printf("NE\n");
else if(h>a&&z<b)printf("SE\n");
else if(h<a&&z<b)printf("SO\n");
else printf("divisa\n");
} }
return 0;
}