輸出樣例
b.out
125
* 30
-----
0
375
-----
3750
(賦:輸出樣例,樓主的格式有問題)
程序:
i,l,t:longint;
nn,mm,ss:longint;
n,m,s:string;
begin
readln(nn,mm);
ss:=nn*mm;
str(nn,n);
str(mm,m);
str(ss,s);
l:=length(s)+1;
if length(m)<>1 then
begin
writeln(n:l);
write('*');writeln(m:l-1);
for i:=1 to l do write('-');writeln;
for i:=length(m) downto 1 do
begin
t:=(ord(m[i])-ord('0'))*nn;
writeln(t:l-(length(m)-i));
end;
for i:=1 to l do write('-');writeln;
writeln(ss:l);
end
else
begin
writeln(n:l);
write('*');writeln(m:l-1);
for i:=1 to l do write('-');writeln;
writeln(s:l);
end;
end.