|
determ.BAS |
|
{* Вычисление детерминанта *}REM basic ' Вычисление детерминанта
20 INPUT "N=";N: Dim A N Then 170
130 T = A (I, K)
140 If ABS (T) < = ABS (MI) Then 160
150 M1 =T:J = I
160 I =I+1: GoTo 120
170 If M1=0 Then D = 0: GoTo 1000
180 If J = K Then 230
190 D= —D:L = K
200 If L>N Then 230
210 T = A (J,L):A (J,L):A (K,L):A(K, L)=T
220 L = L+1: GoTo 200
230 F=K + 1
240 If F>N Then 300
250 T = A (F, К) / M1
260 Z = K + 1
270 If Z>N Then 290
280 A (F, Z) = A (F, Z) —T * A (K, Z):Z = Z+1: GoTo 270
290 F = F+1: GoTo 240
300 D = D * А (К, K)
310 Next
1000 PRINT "DET = "; D: End
|