free pascal 问题 急急急!!!!!!!!!!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/06/03 19:51:01
请用最简洁的程序段解决高精乘 注意:不要涉及过程(procedure)与函数(function) 程序不超过30行

30行不合理吧,如果真看重这个,写一行都可以。

procedure和function和你有仇吗,真正的程序不可能离开这两个东西哦。

按照你的要求,我写出了一个23行的程序,在FREEPASCAL下调试通过,如果你不粘贴错误,保证正确运行:

{$apptype console}
program mul;
const max_rst=255;
var s1,s2:string;
    a,b,c:array [1..max_rst] of integer;
    i,j,k,na,nb,nc,m:integer;
begin
  readln(s1);
  readln(s2);
  na:=length(s1);for i:=1 to na do a[na-i+1]:=ord(s1[i])-ord('0');
  nb:=length(s2);for i:=1 to nb do b[nb-i+1]:=ord(s2[i])-ord('0');
  nc:=na+nb;if nc>max_rst then begin writeln('to big');halt;end;
  for i:=1 to nc do c[i]:=0;
  for i:=1 to nb do
  for j:=1 to na do
&nbs