11 Star 31 Fork 7

duchenhong/北航学院2020C语言程序设计例程

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
未命名5.c 622 Bytes
一键复制 编辑 原始数据 按行查看 历史
duchenhong 提交于 2020-04-29 21:25 . 修改轴对称图形
#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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/duchenhong/programming_routine_2020c.git
git@gitee.com:duchenhong/programming_routine_2020c.git
duchenhong
programming_routine_2020c
北航学院2020C语言程序设计例程
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385