What is "Compilation error"?
What is "Compilation error"?
It seems that there's nothing wrong with my program.
type ac=array[1..100]of longint;
var a,c:array[0..1000]of ac;b,d,e,f,g,h,i,j,k,l,m,n:longint;
function add(a,c:ac):ac;
var i,j:longint;
begin
j:=0;
for i:=100 downto 1 do begin
add[i]:=a[i]+c[i]+j;
j:=add[i] div 10;
add[i]:=add[i] mod 10;
end;
end;
function times(a,c:ac):ac;
var i,j,l:longint;
begin
fillchar(times,sizeof(times),0);
for i:=100 downto 1 do begin
l:=0;
for j:=100 downto 1 do
if i+j-100>0 then begin
times[i+j-100]:=times[i+j-100]+a[i]*c[j]+l;
l:=times[i+j-100] div 10;
times[i+j-100]:=times[i+j-100] mod 10;
end;
end;
end;
procedure out(a:ac);
var i,j:longint;
begin
for i:=1to 100 do
if a[i]<>0 then break;
for j:=i to 100 do
write(a[j]);
writeln;
end;
begin
read(m,n);
if (n mod 2=1)or(m*2*9<n) then
writelN('0')
else begin
fillchar(a,sizeof(a),0);
a[0,100]:=1;
for i:=1to n do begin
c:=a;
fillchar(a,sizeof(a),0);
for j:=1to m do
for l:=0to 9 do
if j>=l then a[j]:=add(a[j],c[j-l]);
end;
out(times(a[m],a[m]));
end;
end.
Re: What is "Compilation error"?
My compiler says
"Error: Not enough actual parameters"
>> add[i]:=a[i]+c[i]+j;
>> fillchar(times,sizeof(times),0);