编写的程序有错误但编译器显示不出错误来,求解
#include<stdio.h>int main()
{
//某运输公司的收费按照用户运送货物的路程进行计算
int iDiscount;
int space;
int iswitch; //表示折扣的检验情况
float danjia,zhongliang,zongjiage;
printf("输入 单价和重量,路程\n");
scanf_s("%f,%f,%d",&danjia ,&zhongliang ,&space);
if(space>3000)
{
iswitch=12 ; //折扣的检验情况为15
}
else
{
iswitch=space/250;
}
//使用switch进行检验
switch(iswitch)
{
case 0:
iDiscount=0;
break;
case 1:
iDiscount=2;
break;
case 2:
case 3:
iDiscount=5;
break;
case 5:
case 6:
case 7:
iDiscount=8;
break;
case 8:
case 9:
case 10:
case 11:
iDiscount=10;
break;
case 12:
iDiscount=12;
break;
default:
break;
}
zongjiage=danjia*zhongliang*space*(1-iDiscount/100.0);
printf("zongjiage是%.4f\n",zongjiage);
getchar();
getchar();
getchar();
return 0;
}
不能运行
[此贴子已经被作者于2017-10-9 10:10编辑过]