急急急!!!这段C语言代码那里错了?怎么改才能运行?

#include<stdio.h>
#include<conio.h>
main()
{
float wares[8];
float aver,highestP,lowestP;
void readprice(float price[8]);
float averPrice(float price[8]);
float highPrice(float price[8]);
float lowePrice(float price[8]);
void prtprice(float price[8],float ave);
readprice(wares);
aver=averPrice(wares);
highestP=highPrice(wares);
lowestP=lowPrice(wares);
printf("The highest Price=%6.2f\n",highestP);
printf("the lowest Price=%6.2f\n",lowestP);
printf("The average Price=%6.2f\n",aver);
prtprice(wares,aver);
getch();
}
void readprice(float price[8])
{
int i;
printf("Enter 8 ware’s price:\n");
for(i=0;i<8;i++)
scanf("%f",&price[i]);
printf("The price of 8 wares is :\n");
for (i=0;i<8;i++)
printf("%6.2f\t",price[i]);
printf("\n");
return;
}
float averprice(float price[8])
{
float sum=0.0;
float ave;
int i;
for (i=0;i<8;i++)
sum=sum+price[i];
ave=sum/8;
return(ave);
}

float highprice(float price[8])
{
float high_temp;
int i;
high_temp=price[0];
for(i=0;i<7;i++)
if (high_temp<price[i+1])
high_temp=price[i+1];
return (high_temp);
}

float lowprice(float price[8])
{
float lowe_temp;
int i;
lowe_temp=price[0];
for(i=0;i<7;i++)
if (price[i]>price[i+1])
lowe_temp=price[i+1];
return(lowe_temp);
}
void prtprice(float price[8],float ave)
{
int i;
printf("The ware which are higher than average price:\n");
for(i=0;i<8;i++)
if(price[i]>ave)
printf("%6.2f\t",price[i]);
return;
}

应该是函数声明和定义的时候没有注意大小写的区分!
你的声明中的price和定义中的"P"rice没有区分开!!
温馨提示:内容为网友见解,仅供参考
第1个回答  2008-07-13
warning C4013: 'lowPrice' undefined; assuming extern returning int
warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data
第2个回答  2008-07-13
第十五行的lowPrice改成lowprice
C语言区分大小写。

而且除了这个还有好多错误啊,比如main()要放到最下面
相似回答
大家正在搜