软件编程版 #164452 层

帮我读读程序!错在哪儿!

楼主 · 1 楼
#include <stdio.h>
#include <math.h>
#define RAD2DEG® (®*57.2957795131)
#define DEG2RAD(d) ((d)/57.2957795131)
double DegreesToMiles(double x1, double y1, double x2, double y2)
{

double a = 6378137; // Use GRS 80 spheroid
double f = 0.003352813; // 1 / 298.257

double F = (DEG2RAD(y1) + DEG2RAD(y2)) / 2.0;
double G = (DEG2RAD(y1) - DEG2RAD(y2)) / 2.0;
double l = (DEG2RAD(x1) - DEG2RAD(x2)) / 2.0;

double sF2 = pow(sin(F),2);
double cF2 = pow(cos(F),2);
double sG2 = pow(sin(G),2);
double cG2 = pow(cos(G),2);
double sL2 = pow(sin(l),2);
double cL2 = pow(cos(l),2);

double S = sG2*cL2 + cF2*sL2;
double C = cG2*cL2 + sF2*sL2;

double omega = atan(sqrt(S/C));
double rho = sqrt(S*C) / omega;

double D = 2*a*omega;

double H1 = (3*rho - 1) / (2*C);
double H2 = (3*rho + 1) / (2*S);

double m = D*(1 + f*(H1*sF2*cG2 - H2*cF2*sG2));

return m * 0.0006214;
}
void mian()
{double x1=1, double y1, double x2, double y2,double dd, double ll,double ko;
int i;
while(x1!=0)
{scanf("%f%f%f%",&x1,&y1,&x2,&y2);
dd=DegreesToMiles(x1,y1,x2,y2);
printf("%.5f",dd);
ll=dd*1.852;
printf("%.5f",ll);
ko=ll/999.199;
printf("%.5f\n",ko);
}
}

显示的错误:--------------------Configuration: 经纬度计算程序 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/经纬度计算程序.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

经纬度计算程序.exe - 2 error(s), 0 warning(s)

2 楼
void mian()
{double x1=1, double y1, double x2, double y2,double dd, double ll,double ko;
int i;
while(x1!=0)
{scanf("%f%f%f%",&x1,&y1,&x2,&y2);
dd=DegreesToMiles(x1,y1,x2,y2);
printf("%.5f",dd);
ll=dd*1.852;
printf("%.5f",ll);
ko=ll/999.199;
printf("%.5f\n",ko);
}

大哥,小弟不才,看到你的错误是: mian 打错了 应该是main