这些用PASCAL语言怎么编?

来源:百度知道 编辑:UC知道 时间:2024/05/09 18:33:14
1、株洲市的士费起价3元,可以行使2公里,2公里后价格按每公里1.2元计算,输入的士行驶的公理数,请你计算出顾客付费多少?

2、某超市为了促销,规定:购物不足50元的按原价付款,超过50不足100的按九折付款,超过100元的,超过部分按8折付款。编一程序完成超市的自动计费工作。

3、输入4个整数,要求按由小到大的顺序输出。

这些怎么编?..知道的请说下...谢谢
要用Pascal语言

现在着急要, 我在线等
谢谢。。。可以加悬赏分。。。越快越好啊。。。

1.
program a1;
var n:longint;
cost:real;
begin
read(n);
if n<=2 then cost:=3;
if n>2 then cost:=3+(n-3)*1.2;
writeln(cost:0:3);
end.

2.

program a2;
var n:longint;
cost:real;
begin
read(n);
if n<50 then cost:=50;
if ((n<=50) and (n<100)) then cost:=n*0.9;
if n>100 then cost:=(100*0.9)+(n-100)*0.8;
writeln(cost:0:3);
end.

3.

program a3;
var n:longint;
jiaohuan:real;
begin
read(a,b,c,d);
if a>b then jiaohuan (a,b);
if b>c then jiaohuan (b,c);
if c>d then jiaohuan (c,d);
if a>c then jiaohuan (a,c);
if b>d then jiaohuan (b,d);
if a>d then jiaohuan (a,d);
writeln(jiaohuan:a,b,c,d)
end.

一:
program a1;
var n:longint;
begin
read(n);
if n<3 then writeln(3) else writeln((n-2)*1.2+3);
end.
二:
program a2;
var n:real