```
#include
int main()
{int c,s;
float p,w,d,f; //s是运输距离,p是基本运费,w是货物重量,d是折扣,f是总运费
scanf("%lf%lf%lf",&s,&p,&w);
c=s/250;
switch(c)
{case 0:d=0;break;
case 1:d=0.02;break;
case 2:
case 3:d=0.05;break;
case 4:
case 5:
case 6:
case 7:
case 8:d=0.08;break;
case 9:
case 10:
case 11:d=0.1;break;
default:d=0.15;break;
}
printf("f=%f",f=pws*(1-d));
return 0;
}```
float输入用%f,%lf是和收入double的