主题:求助~!!!!!
题目:
某运输公司的运费标准如下:
1、当运输距离s>300公里时:
货重w<2吨时,按98%收费;
2<w<4时,按96%收费;
4<w<6时,按94%收费;
w>6时,按92%收费。
2、当运输距离s<300公里时:
w<2时,按100%收费;
2<w<4时,按98%收费;
4<w<6时,按96%收费;
w>6时,按94%收费。
在写程序前,设P为每公里运费,cost为向用户收取的费用。
程序如下:
program carriage(input,output);
var
s300:boolean;
p,w,s,cpst:real;
begin
write('please input p,w,s:');
readln(p,s,w);
cost:=p*w*e;
s300:= s>=300;
If s300 and (w<=2) then
cost:=cost*0.98;
If s300 and (w>=2) and (w<4) then
cost:=cost*0.96;
If s300 and (w>=4) and (w<6) then
cost:=cost*0.94;
If s300 and (w>=6) then
cost:=cost*0.92;
If not s300 and (w>=2) and (w<4) then
cost:=cost*0.98;
If not s300 and (w>=4) and (w<6) then
cost:=cost*0.96;
If not s300 and (w>=6) then
cost:=cost*0.94;
writeln('price=',p:6:2, 'wight=',w:6:2, 'distance=',s:6:2);
writeln('cost=',cost:6:2)
end.
请各位GGJJDDMM们,看看这个程序哪里出错了,怎么不可以运行?
某运输公司的运费标准如下:
1、当运输距离s>300公里时:
货重w<2吨时,按98%收费;
2<w<4时,按96%收费;
4<w<6时,按94%收费;
w>6时,按92%收费。
2、当运输距离s<300公里时:
w<2时,按100%收费;
2<w<4时,按98%收费;
4<w<6时,按96%收费;
w>6时,按94%收费。
在写程序前,设P为每公里运费,cost为向用户收取的费用。
程序如下:
program carriage(input,output);
var
s300:boolean;
p,w,s,cpst:real;
begin
write('please input p,w,s:');
readln(p,s,w);
cost:=p*w*e;
s300:= s>=300;
If s300 and (w<=2) then
cost:=cost*0.98;
If s300 and (w>=2) and (w<4) then
cost:=cost*0.96;
If s300 and (w>=4) and (w<6) then
cost:=cost*0.94;
If s300 and (w>=6) then
cost:=cost*0.92;
If not s300 and (w>=2) and (w<4) then
cost:=cost*0.98;
If not s300 and (w>=4) and (w<6) then
cost:=cost*0.96;
If not s300 and (w>=6) then
cost:=cost*0.94;
writeln('price=',p:6:2, 'wight=',w:6:2, 'distance=',s:6:2);
writeln('cost=',cost:6:2)
end.
请各位GGJJDDMM们,看看这个程序哪里出错了,怎么不可以运行?