program1.txt
来自「编译原理课程设计大作业PL0文法简易编译器」· 文本 代码 · 共 27 行
TXT
27 行
const z=0;
var head,foot,cock,rabbit,n:integer;
begin
n:=z;
read(head,foot);
cock:=1;
cock:=cock+1;
for cock:= 1 downto 1 do
begin
writeln(0)
end;
cock:=1;
while cock<=head do
begin
rabbit:=head-cock;
if cock*2+rabbit*4=foot then
begin
write(cock,rabbit);
n:=n+1
end;
cock:=cock+1;
end;
if n=0 then write(0,0)
end.