主题:各位高手帮忙看看这个函数调用的程序怎么调不出数据来啊!
各位高手帮忙看看这个函数调用的程序怎么调不出数据来啊!
输入2048QQ.DAT文件里全是0!
DECLARE SUB NUM (N, M)
DIM N0(2048), N1(4096)
INPUT "NN=", NN
call NUM(NN/2, N0)
call NUM(NN, N1)
OPEN "QQ.DAT" FOR OUTPUT AS #2
FOR I = 1 TO NN
PRINT #2, N0(I): NEXT I
END
SUB NUM (N, M)
DIM M(N)
M(0) = 0
M(1) = N / 2
FOR K = 2 TO N - 2 STEP 2
M(K) = M(K / 2) / 2
M(K + 1) = M(K) + N / 2: PRINT M(K): NEXT K
END SUB[em6]
输入2048QQ.DAT文件里全是0!
DECLARE SUB NUM (N, M)
DIM N0(2048), N1(4096)
INPUT "NN=", NN
call NUM(NN/2, N0)
call NUM(NN, N1)
OPEN "QQ.DAT" FOR OUTPUT AS #2
FOR I = 1 TO NN
PRINT #2, N0(I): NEXT I
END
SUB NUM (N, M)
DIM M(N)
M(0) = 0
M(1) = N / 2
FOR K = 2 TO N - 2 STEP 2
M(K) = M(K / 2) / 2
M(K + 1) = M(K) + N / 2: PRINT M(K): NEXT K
END SUB[em6]