题目:
输入任意两个三位的自然数,写出它们完整的乘法竖式。
代码:
1 program work20161202; 2 var 3 a,b,c,d,e:integer; 4 BEGIN 5 readln(a,b); 6 c:=b mod 10; 7 d:=b mod 100 div 10; 8 e:=b div 100; 9 writeln(a:10); 10 writeln('*',b:9); 11 writeln('----------'); 12 writeln(a*c:10); 13 writeln(a*d:9); 14 writeln(a*e:8); 15 writeln('----------'); 16 writeln(a*b:10); 17 END.
老师的答案: