pascal ";"expected but "."foundvar a,t:int64;begin readln(a);t:=a-3500;if t1500)and(t4500)and (t9000)and(t35000)and(t55000)and(t
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 09:47:04
pascal ";"expected but "."foundvar a,t:int64;begin readln(a);t:=a-3500;if t1500)and(t4500)and (t9000)and(t35000)and(t55000)and(t
pascal ";"expected but "."found
var a,t:int64;
begin readln(a);
t:=a-3500;
if t1500)and(t4500)and (t9000)and(t35000)and(t55000)and(t
pascal ";"expected but "."foundvar a,t:int64;begin readln(a);t:=a-3500;if t1500)and(t4500)and (t9000)and(t35000)and(t55000)and(t
var a,t:int64;
begin
readln(a);
t:=a-3500;
if t<=1500 then writeln(t*0.03);
if (t>1500)and(t<=4500) then writeln(t*0.1);
if (t>4500)and (t<=9000) then writeln(t*0.2);
if (t>9000)and(t<=35000) then writeln(t*0.25);
if (t>35000)and(t<=55000) then writeln(t*0.3);
if (t>55000)and(t<=80000) then writeln(t*0.35);
if t>80000 then writeln(t*0.45);
End.
每一个判断语句后面执行的命令只有一条,则可以省略begin...end,如果要执行的命令超过一条则需要使用.
最后一种情况,也要使用if判断,否则,前面无论那条判断成立输出结果后,到这里都会再次输出t*0.45的结果.