p42 实验溢出(上溢)
//42 溢出 program test; var i:longint; //i为循环变量 b:byte; begin b:=250; for i:=1 to 10 do begin write( b:4, space(4) ); //变量b的输入场宽为4,space(n)表示n个空格 writeln( binstr(b,8) ); //输出八位二进制 inc(b); //相当于 b:=b+1; 变量b累加1 end; end.
The eagles are coming!
//42 溢出 program test; var i:longint; //i为循环变量 b:byte; begin b:=250; for i:=1 to 10 do begin write( b:4, space(4) ); //变量b的输入场宽为4,space(n)表示n个空格 writeln( binstr(b,8) ); //输出八位二进制 inc(b); //相当于 b:=b+1; 变量b累加1 end; end.