代码拉取完成,页面将自动刷新
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main()
{
double x, y;
scanf("%d%d",&x,&y);
if(x==0 && y==0){
printf("Bingo");
}
else if(x>0 && y==0){
printf("E\n");
}
else if(x<0 && y==0){
printf("W\n");
}
else if(x==0 && y>0){
printf("N\n");
}
else if(x==0 && y<0){
printf("S\n");
}
else if(x>0 && y>0){
printf("NE%.2f\n",atan(x/y) * 180 / PI);
}
else if(x<0 && y>0){
printf("NW%.2f\n",atan((-x)/y) * 180 / PI);
}
else if(x<0 && y<0){
printf("SW%.2f\n",atan((-x)/(-y)) * 180 / PI);
}
else if(x>0 && y<0){
printf("SE%.2f\n",atan(x/(-y)) * 180 / PI);
}
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。