假如這三個(gè)數(shù)組分別是X(0,1,2)    Y(0,1)    z(1,2,3,4,5,6)    變量初值 ii:=0;     h:=0;
IF m1 THEN
    FOR i:=1 to 6 do
        If i<=3 then
            z(i):=x(ii)*y(0);
        Elsif i>3 then 
            ii:=0;
            z(i):=x(ii)*y(1);
        End_if;
        If i=6 then
           h:=z(1)+z(2)+z(3)+z(4)+z(5)+z(6);
           i:=0;
           ii:=0;
           m1:=false;
         end_if;
         ii:=ii+1;
    End_for;
Else
   ii:=0;
End_if;
Z1:=x0*y0
Z2:=x1*y0
Z3:=x2*y0
Z4:=x0*y1
Z5:=x1*y1
Z6:=x2*y1
理論上應(yīng)該可以實(shí)現(xiàn)樓主的要求,具體可能需要測(cè)試