⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sample3.pl0

📁 编译器代码
💻 PL0
字号:
const bound=30;
var input, count;
procedure guess;
var temp, upper, lower;
procedure locate;

begin
temp:=(upper+lower)/2;
if temp<input then
lower:=temp+1;
if temp>input then
upper:=temp-1;
end;

begin
upper:=bound;
lower:=0;
temp:=(upper+lower)/2;
while temp#input do
begin
count:=count+1;
call locate;
end;
end;

begin
input:=6;
count:=1;
call guess;
write(count);
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -