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 (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(1, A)); OUTREAL(99,SUM(2, B)); end