begin array A[1 : 3], B[1 : 3, 1 : 3]; real procedure SUM(DIM, A); value DIM; integer DIM; array A; SUM ≔ if DIM = 1 then A[1]+ A[2]+ A[3] else SUM2(A); real procedure SUM2(A); array 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; OUTREAL(99,SUM(2, A)); OUTREAL(99,SUM(1, B)) end