永发信息网

Devc++遇到的问题,编译完成显示[Error] ld returned 1 exit status,代码放下面

答案:1  悬赏:0  手机版
解决时间 2021-03-10 08:13
//Azimuth inverse calculation;calculate the distant and angle according to known coordinates
# include <stdio.h>
# include <math.h>
# define PI 3.1415926
int main()
{
double AngleTransfer(int a,int b,int c);//transfer the angle from array into radian.
double dx,dy,distant,a[2],b[2];//a[2] means xa and ya,so as b[2];and dx,dy is the
int alpha[3];//storage the angle as an array-degree,minute and second
printf("please input xa,ya:\n");
scanf("%f %f",&a[0],&a[1]);
printf("please input alpha:\n");
scanf("%d %d %d",&alpha[0],&alpha[2],&alpha[3]);
printf("intput the distant:\n");
scanf("%f",&distant);
dx=a[0]+distant*cos(AngleTransfer(alpha[0],alpha[1],alpha[2]));
dy=a[1]+distant*sin(AngleTransfer(alpha[0],alpha[1],alpha[2]));
b[0]=a[0]+dx;
b[1]=a[1]+dy;
prinft("bx is:%d\nby is %d\n",b[0],b[1]);
return 0;
}
double AngleTransfer(int a,int b,int c)
{
double angle;
angle=(a+b/60+c/3600)*180/PI;
return angle;
}
最佳答案
scanf("%d %d %d",&alpha[0],&alpha[2],&alpha[3]);
这里数组越界,下标应该是0,1,2;
scanf("%f %f",&a[0],&a[1]);
scanf("%f",&distant);
double类型输入需要用%lf
改掉后运行就没问题了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
天体表面的重力加速度与什么有关
张记老家面馆在哪里啊,我有事要去这个地方
这两个式子为什么相等?字被遮挡住了,我补充
隐函数求导的方法?谁能说明白点,给些例子,书
一款游戏,是用一些实物的阴影对出一个东西,
晚上做了房事早上可以去寺庙求神吗?
【regulatory】为什么在ISO9001标准中regulat
武林风门业钢板门四扇多少钱一平方
怎么看电脑激活状态
手工折纸大全图解【免费】幼儿折纸大全图解儿
小刚小阳和小丽参加100米的短跑比赛,小刚比小
芭比蛋糕店怎么去啊,有知道地址的么
长智邮政支局地址在哪,我要去那里办事
从上海虹桥枢纽出发,要去吴江,问问看长途车
qq三国的符咒有什么用
推荐资讯
1.本诗作者是___(地区)著名诗人.他的一首思乡
葆婴直销排名第几在世界排名第几名
什么含钙最高水果,酸角是含钙最高的吗?
汽车跑了一公里,剩余公里数掉了4个正常?
He acted___he had never lived in England b
我才15岁,感觉却像20多岁的人了,感觉好沧桑
电信宽带缴费多久可以上网
虚拟机安装好xp系统,怎么封装
请教如何编写 1+3+5+...+999的程序
矿大的采矿专业真的好吗?
We've just installed two air-conditio
下列是某海洋生态系统食物链和食物网示意图,
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?