我这VB选择排序法怎么错了?For i = 0 To o - 1min = c(i)n = iFor j = i To o - 1If c(j) < min Thenmin = c(j)n = jEnd IfNextc(n) = c(i)c(i) = minNextnext
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 19:57:38
我这VB选择排序法怎么错了?Fori=0Too-1min=c(i)n=iForj=iToo-1Ifc(j)我这VB选择排序法怎么错了?Fori=0Too-1min=c(i)n=iForj=iToo-1
我这VB选择排序法怎么错了?For i = 0 To o - 1min = c(i)n = iFor j = i To o - 1If c(j) < min Thenmin = c(j)n = jEnd IfNextc(n) = c(i)c(i) = minNextnext
我这VB选择排序法怎么错了?
For i = 0 To o - 1
min = c(i)
n = i
For j = i To o - 1
If c(j) < min Then
min = c(j)
n = j
End If
Next
c(n) = c(i)
c(i) = min
Next
next
我这VB选择排序法怎么错了?For i = 0 To o - 1min = c(i)n = iFor j = i To o - 1If c(j) < min Thenmin = c(j)n = jEnd IfNextc(n) = c(i)c(i) = minNextnext
1.多个next(两个for,三个next)
2.变量o没有赋初值,应该是序列c()的样本个数.