PROGRAM MAIN
IMPLICIT NONE
REAL MATRIX
INTEGER :: x, y, q
INTEGER, PARAMETER :: I =18-40 ,J = 18+20,K = 9-18,L = 20-18
q=90-18
REAL, DIMENSION(I:J,K:L) :: A
DO x=I,J
DO y=K,L
A(x,y)=MATRIX(x,y,18)
END DO
END DO
DO x=I,J
DO y=K,L
WRITE (*,advance='no'),A(x,y),' '
END DO
Print *,''
END DO
read(*,*)
END
CONTAINS
REAL FUNCTION MATRIX (x, y, N)
REAL x, y, SUM
INTEGER i, q, N
SUM = 0
q = 90-N
DO i=1,q
SUM = SUM + x*(y**i)
END DO
MATRIX = SUM
RETURN
END
IMPLICIT NONE
REAL MATRIX
INTEGER :: x, y, q
INTEGER, PARAMETER :: I =18-40 ,J = 18+20,K = 9-18,L = 20-18
q=90-18
REAL, DIMENSION(I:J,K:L) :: A
DO x=I,J
DO y=K,L
A(x,y)=MATRIX(x,y,18)
END DO
END DO
DO x=I,J
DO y=K,L
WRITE (*,advance='no'),A(x,y),' '
END DO
Print *,''
END DO
read(*,*)
END
CONTAINS
REAL FUNCTION MATRIX (x, y, N)
REAL x, y, SUM
INTEGER i, q, N
SUM = 0
q = 90-N
DO i=1,q
SUM = SUM + x*(y**i)
END DO
MATRIX = SUM
RETURN
END