十进制实数转二进制的程序Program zy6;var bin:array [0..50] of 0..1;x:longint;k,i:integer;beginwriteln('read decimal data x:'); read(x);for i:=0 to 50 do bin[i]:=0;k:=0;while x>0 dobeginbin[k]:=x mod 2;x:=x div 2;k:=k+1;end;writeln('Binary:
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 05:41:46
十进制实数转二进制的程序Program zy6;var bin:array [0..50] of 0..1;x:longint;k,i:integer;beginwriteln('read decimal data x:'); read(x);for i:=0 to 50 do bin[i]:=0;k:=0;while x>0 dobeginbin[k]:=x mod 2;x:=x div 2;k:=k+1;end;writeln('Binary:
十进制实数转二进制的程序
Program zy6;
var bin:array [0..50] of 0..1;
x:longint;
k,i:integer;
begin
writeln('read decimal data x:'); read(x);
for i:=0 to 50 do bin[i]:=0;
k:=0;
while x>0 do
begin
bin[k]:=x mod 2;x:=x div 2;
k:=k+1;
end;
writeln('Binary:');
for i:=k-1 downto 0 do write(bin[i]:1);
end.
十进制实数转二进制的程序Program zy6;var bin:array [0..50] of 0..1;x:longint;k,i:integer;beginwriteln('read decimal data x:'); read(x);for i:=0 to 50 do bin[i]:=0;k:=0;while x>0 dobeginbin[k]:=x mod 2;x:=x div 2;k:=k+1;end;writeln('Binary:
你这是整数的转换程序啊.