编程题调试出问题了,旦不知道怎么解决,高手帮忙

#include<stdio.h>charo[8]={'A','B','C','D','E','F','G','H'};floatp[8]={100,50,25,10,5... #include<stdio.h>
char o[8]={'A','B','C','D','E','F','G','H'};
float p[8]={100,50,25,10,5,2.5,1,0.5};

d(double,double,float);
main()
{

int i,h;
double j,w;
float s[3],t[3];
float q;
printf("请输入所需求的比例尺:1:");
scanf("%f",&q);
printf("请输入分别经度和纬度,度分均用空格代替:");
for(i=0;i<3;i++)
scanf("%f",&s[i]);
for(h=0;h<3;h++)
scanf("%f",&t[h]);
j=s[0]+s[1]/60.0+s[2]/3600.0;
w=t[0]+t[1]/60.0+t[2]/3600.0;
d(j,w,q);
}

d(double j,double w,float q)
{
double a,b,i;
double jc[8]={6.0,3.0,1.5,0.5,0.25,0.125,0.0625,0.03125},
wc[8]={4.0,2.0,1.0,1.0/3,1.0/6,1.0/12,1.0/24,1.0/48};
double c,d,m,n;
a=j/jc[0]+1;
if(j>=0&&j<=180)
b=j/6+31;
else
b=31-j/6;
printf("该经纬度所在的图幅编号为:");
printf("%d%d",(int)a,(int)b);
for(i=0;i<8;i++)
{if(q==p[i]) #include<stdio.h>
char o[8]={'A','B','C','D','E','F','G','H'};
float p[8]={100,50,25,10,5,2.5,1,0.5};

d(double,double,float);
main()
{

int i,h;
double j,w;
float s[3],t[3];
float q;
printf("请输入所需求的比例尺:1:");
scanf("%f",&q);
printf("请输入分别经度和纬度,度分均用空格代替:");
for(i=0;i<3;i++)
scanf("%f",&s[i]);
for(h=0;h<3;h++)
scanf("%f",&t[h]);
j=s[0]+s[1]/60.0+s[2]/3600.0;
w=t[0]+t[1]/60.0+t[2]/3600.0;
d(j,w,q);
}

d(double j,double w,float q)
{
double a,b,i;
double jc[8]={6.0,3.0,1.5,0.5,0.25,0.125,0.0625,0.03125},
wc[8]={4.0,2.0,1.0,1.0/3,1.0/6,1.0/12,1.0/24,1.0/48};
double c,d,m,n;
a=j/jc[0]+1;
if(j>=0&&j<=180)
b=j/6+31;
else
b=31-j/6;
printf("该经纬度所在的图幅编号为:");
printf("%d%d",(int)a,(int)b);
for(i=0;i<8;i++)
{if(q==p[i])
break;
}
m=w/(wc[i]*4.0);
c=4.0/wc[i]-m;
n=j/(jc[i]*6.0);
d=n+1;
if(i!=0)
{printf("%c",q);
if(c<=9)
{printf("00");
printf("%d",c);}
else if(c>9&&c<=99)
{
printf("0");
printf("%d",c);
}
else
printf("%d",c);
if(d<=9)
{printf("00");
printf("%d",d);}
else if(d>9&&d<=99)
{
printf("0");
printf("%d",d);
}
else
printf("%d",d);
}
}
break;
}
m=w/(wc[i]*4.0);
c=4.0/wc[i]-m;
n=j/(jc[i]*6.0);
d=n+1;
if(i!=0)
{printf("%c",q);
if(c<=9)
{printf("00");
printf("%d",c);}
else if(c>9&&c<=99)
{
printf("0");
printf("%d",c);
}
else
printf("%d",c);
if(d<=9)
{printf("00");
printf("%d",d);}
else if(d>9&&d<=99)
{
printf("0");
printf("%d",d);
}
else
printf("%d",d);
}
}
展开
 我来答
aslon001
2009-04-02 · TA获得超过514个赞
知道答主
回答量:51
采纳率:100%
帮助的人:50.5万
展开全部
哥们,你这个程序太乱了,帮你改了一下,也看不清你是做什么,结果对不对就不知道了。反正通过了。
#include<stdio.h>

char o[8]={'A','B','C','D','E','F','G','H'};
float p[8]={100,50,25,10,5,2.5,1,0.5};

void d(double,double,float);
void main()
{
int i,h;
double j,w;
float s[3],t[3];
float q;
bool b=false;
while (1) {
printf("请输入所需求的比例尺:1:");
scanf("%f",&q);
for (int k=0;k<8;k++)
if (p[k]==q)
b=true;
if (b)
break;
}

printf("请输入分别经度和纬度,度分均用空格代替:\r\n");
scanf("%f %f %f",&s[0],&s[1],&s[2]);
scanf("%f %f %f",&t[0],&t[1],&t[2]);
j=s[0]+s[1]/60.0+s[2]/3600.0;
w=t[0]+t[1]/60.0+t[2]/3600.0;
d(j,w,q);
}

void d(double j,double w,float q)
{
int i;
double a,b;
double jc[8]={6.0,3.0,1.5,0.5,0.25,0.125,0.0625,0.03125},
wc[8]={4.0,2.0,1.0,1.0/3,1.0/6,1.0/12,1.0/24,1.0/48};
double c,d,m,n;
a=j/jc[0]+1;
if(j>=0&&j<=180)
b=j/6+31;
else
b=31-j/6;
printf("该经纬度所在的图幅编号为:");
printf("%d%d",(int)a,(int)b);
for(i=0;i<8;i++)
if(q==p[i])
break;
m=w/(wc[i]*4.0);
c=4.0/wc[i]-m;
n=j/(jc[i]*6.0);
d=n+1;
if(i!=0)
{
printf("%c",q);
if(c<=9)
{
printf("00");
printf("%d",c);
}
else if(c>9&&c<=99)
{
printf("0");
printf("%d",c);
}
else
printf("%d",c);
if(d<=9)
{
printf("00");
printf("%d",d);
}
else if(d>9&&d<=99)
{
printf("0");
printf("%d",d);
}
else
printf("%d",d);
}
}
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
zht021
2009-04-02 · TA获得超过1952个赞
知道大有可为答主
回答量:1365
采纳率:0%
帮助的人:1313万
展开全部
好长,这么多错误,你自己先检查检查再说吧。

--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
E:\Cpp1.cpp(23) : warning C4508: 'main' : function should return a value; 'void' return type assumed
E:\Cpp1.cpp(39) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(39) : error C2446: '==' : no conversion from 'float *' to 'float'
There is no context in which this conversion is possible
E:\Cpp1.cpp(39) : error C2115: '==' : incompatible types
E:\Cpp1.cpp(39) : error C2014: preprocessor command must start as first nonwhite space
E:\Cpp1.cpp(43) : error C2144: syntax error : missing ')' before type 'double'
E:\Cpp1.cpp(43) : error C2064: term does not evaluate to a function
E:\Cpp1.cpp(43) : error C2059: syntax error : ')'
E:\Cpp1.cpp(45) : error C2143: syntax error : missing ';' before '{'
E:\Cpp1.cpp(60) : error C2064: term does not evaluate to a function
E:\Cpp1.cpp(63) : error C2144: syntax error : missing ')' before type 'double'
E:\Cpp1.cpp(63) : error C2064: term does not evaluate to a function
E:\Cpp1.cpp(63) : error C2059: syntax error : ')'
E:\Cpp1.cpp(64) : error C2143: syntax error : missing ';' before '{'
E:\Cpp1.cpp(77) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(77) : error C2446: '==' : no conversion from 'float *' to 'float'
There is no context in which this conversion is possible
E:\Cpp1.cpp(77) : error C2115: '==' : incompatible types
E:\Cpp1.cpp(80) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(80) : error C2296: '*' : illegal, left operand has type 'double *'
E:\Cpp1.cpp(81) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(81) : error C2297: '/' : illegal, right operand has type 'double *'
E:\Cpp1.cpp(82) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(82) : error C2296: '*' : illegal, left operand has type 'double *'
E:\Cpp1.cpp(110) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(110) : error C2296: '*' : illegal, left operand has type 'double *'
E:\Cpp1.cpp(111) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(111) : error C2297: '/' : illegal, right operand has type 'double *'
E:\Cpp1.cpp(112) : error C2108: subscript is not of integral type
E:\Cpp1.cpp(112) : error C2296: '*' : illegal, left operand has type 'double *'
E:\Cpp1.cpp(137) : warning C4508: 'd' : function should return a value; 'void' return type assumed
Error executing cl.exe.

Cpp1.exe - 28 error(s), 2 warning(s)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式