begin
   integerarray
     A[1 : 3],
     B[1 : 3, 1 : 3];
   procedure SUM(DIM, A);
      value
        DIM;
      integer
        DIM;
        integerarray
        A;
      SUM ≔         if DIM = 1 then
        A[1]+ A[2]+ A[3]
      else
        SUM2(A);
   procedure SUM2(A);
      integerarray
        A;
      SUM2 ≔ A[1, 1]+ A[1, 2]+ A[1, 3]+ A[2, 1]+ A[2, 2]+
        A[2, 3]+ A[3, 1]+ A[3, 2]+ A[3, 3];
   integer
     I,
     J;
   for I ≔ 1,
     2,
     3 do
      begin
         A[I] ≔ I × I;
         for J ≔ 1,
           2,
           3 do
              B[I, J] ≔ A[I]+ J
      end;
   OUTINTEGER(99,SUM(1, A));
   OUTINTEGER(99,SUM(2, B))
end