PASCAL高精度的例题与解答,越多越好,一题10分

来源:百度知道 编辑:UC知道 时间:2024/09/25 09:35:48
PASCAL高精度的例题与解答,越多越好,一题10分

1.

var
sl,sl1:longint;
begin
repeat
readln(sl);
write(sl,'=');
if sl<1 then break
else if sl=1 then write(sl)
else begin
sl1:=2;
while sl>1 do begin
if sl mod sl1=0 then begin
sl:=sl div sl1;
write(sl1);
if sl>1 then write('*');
end else inc(sl1)
end;
end;
writeln;
until false;
end.

2.
var
sw:word;
ss:string;
begin
repeat
readln(sw);
if sw>32767 then break;
ss:='';
while sw>0 do begin
ss:=chr(48+sw and 1);
sw:=sw shr 1;
end;
writeln(ss);
until false;
end.

3.
var
ss1,ss2:string;
si1,si2,si3,si4,si5:integer;
begin
repeat
readln(ss1);
if ss1='' then break;
si1:=-1;
while ss1>'' do begin
while (ss1>'')and(ss1[1]=#32) d