|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <stdio.h>
void main ()
{
int c,s;
float f,p,w,d;
scanf("%f%f%d",&p,&w,&s);
if(s>=3000)
{
c = 12;
}
else
{
c = s/250;
}
switch(c)
{
case 0:
{
d = 0;
break;
}
case 1:
{
d = 2;
break;
}
case 2:
case 3:
{
d = 5;
break;
}
case 4:
case 5:
case 6:
case 7:
{
d = 8;
break;
}
case 8:
case 9:
case 10:
case 11:
{
d = 10;
break;
}
case 12:
{
d = 15;
break;
}
}
f = p * s *(1-d/100.0);
prrintf("f = %15.4f\n",f);
}
错误是这个
C:\Users\djinn\Desktop\c\运费\collect2.exe [Error] ld returned 1 exit status
他说我的d返回1了,不知道什么意思。
本帖最后由 风过无痕1989 于 2020-11-3 00:55 编辑
prrintf("f = %15.4f\n",f); 拼写错误,改为:
printf("f = %15.4f\n",f);
|
|