Variable format
问题 I wrote a program to calculate a square finite difference matrix, where you can enter the number of rows (equals the number of columns) -> this is stored in the variable matrix. The program works fine: program fin_diff_matrix implicit none integer, dimension(:,:), allocatable :: A integer :: matrix,i,j print *,'Enter elements:' read *, matrix allocate(A(matrix,matrix)) A = 0 A(1,1) = 2 A(1,2) = -1 A(matrix,matrix) = 2 A(matrix,matrix-1) = -1 do j=2,matrix-1 A(j,j-1) = -1 A(j,j) = 2 A(j,j+1) =