如何把几个数逆序排列?Private Sub Command1_Click() Static b As Variant B=Array(1,3,5,7,9) ……End sub如何把数组b中的5个数逆序存放(即排列为9,7,5,3,1)后面的程序怎么写啊?
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/28 18:34:56
如何把几个数逆序排列?Private Sub Command1_Click() Static b As Variant B=Array(1,3,5,7,9) ……End sub如何把数组b中的5个数逆序存放(即排列为9,7,5,3,1)后面的程序怎么写啊?
如何把几个数逆序排列?
Private Sub Command1_Click()
Static b As Variant
B=Array(1,3,5,7,9)
……
End sub
如何把数组b中的5个数逆序存放(即排列为9,7,5,3,1)
后面的程序怎么写啊?
如何把几个数逆序排列?Private Sub Command1_Click() Static b As Variant B=Array(1,3,5,7,9) ……End sub如何把数组b中的5个数逆序存放(即排列为9,7,5,3,1)后面的程序怎么写啊?
Private Sub rank(n As Integer, a() As Long)
For i = 1 To n - 1
For j = i + 1 To n
If a(j) > a(i) Then t = a(i): a(i) = a(j): a(j) = t
Next j
Next i
End Sub
void rank1(int a[],int n)
{
int i,j,t;
for (i=0;i a(tmax) Then tmax = j
Next j
If tmax i Then t = a(i): a(i) = a(tmax): a(tmax) = t
Next i
End Sub
void rank1(int a[],int n)
{int i,j,t,tmax;
for (i=0;i