{冒泡排序}
{输入m,表示要排序的数的个数;接着输入m个整数;
输出从小到大排序后的结果}
program p
var integer i,j,num;
array[1..20] of integer a;
procedure q(integer num);
var integer i,j,k;
integer t;
begin
{递归调用测试}
{功能:对于输入n,输出n的阶乘}
program sd
var integer s;
integer t;
procedure factor(integer n;var integer m);
var integer w;
begin
if n=0
then m:=1
else
factor(n-1,w);
m:=n*w
fi
en
{输入n,r ; 从前n个自然数中取r个数作组合}
program combination
type
s=array [1..20] of integer;
var
s a;
integer n,r;
procedure com(integer s,j);
var integer i,k;
begin
i:=s;
while i
{数组测试}
{结果应为:0,1,2,3,4,5}
program sd
type i=integer;
sarray=array [0..5] of integer;
var i x;
sarray y;
integer ss;
procedure sd(integer a);
begin
write(a)
end
be
{简单的过程调用,测试变参的传递}
program pp
var integer v1;
char c;
procedure f();
begin
v1 :=2
end
procedure t1();
var integer v1;
begin
v1 :=1
end
begin
read(v1);
t1();
wri
{值参、变参结合功能测试}
program sd
var
integer x,y,z;
procedure f(integer x,y;var integer z);
begin
z:=x+y+z;
write(x);
write(y);
write(z)
end
begin
x:=3;
y:=4;
z:=5;
{给出一个错误的程序,测试是否能够检查出来,
并给出错误 提示信息}
program _error
var integer s;
integer t;
procedure factor(intaeger n;var integer m);
var integer w;
begin
if n=0
then m:=1
else
factor(n-1,w);