SUBROUTINE SYSTEM ( MXN, N , A , C )
      IMPLICIT REAL*8 ( A-H , O-Z )
      DIMENSION A (MXN,MXN) , C (MXN)
      N1 = N - 1
      DO K = 1, N1
      L = K + 1
      DO I = L , N
      P = A (I,K) / A (K,K)
      IF ( P .NE. 0. ) THEN
      DO J = L , N
      A (I,J) = A (I,J) - P * A ( K , J )
      END DO
      C ( I ) = C ( I) - P * C ( K )
      END IF
      END DO
      END DO
C---- BACK SUBSTITUTION
      C (N) = C (N) / A (N,N)
      DO K = 1 , N1
      I = N - K
      L = I + 1
      P = C ( I )
      DO J = L , N
      P = P - C (J) * A (I,J)
      END DO
      C ( I ) = P / A (I,I)
      END DO
      RETURN
      END