程序也很简单
var
z,j,h,p:integer;
begin
repeat
randomize;
z:=random(100);
j:=0;
repeat
write('Please input a number(0-100):');
read(h);
j:=j+1;
if h=z then writeln('You are right!');
if h>z then writeln('Too big,please try again!');
if h<z then writeln('Too small,please try again!');
until (h=z)or(j=10);
if(j=10)and(h<>z) then writeln('You are fail.The number is',z);
writeln('Do you play again?(1=yes,0=no)');
read(p);
until p=0;
end.