strnum=Array(7,2,5,4,9,8,10,23,12,21)
for i=0 to UBound(strnum) -1
intre= strnum(i) mod 2
If intre <> 0 Then
intre1=strnum(i+1) mod 2
If intre1 = 0 Then
intnumber=strnum(i)
strnum(i)=strnum(i+1)
strnum(i+1)=intnumber
else
For j=i+2 to Ubound(strnum)
If strnum(j) mod 2 =0 Then
intnumber=strnum(i)
strnum(i)=strnum(j)
strnum(j)=intnumber
Exit for
End If
Next
End if
End if
Next
For i=0 to Ubound(strnum)
print strnum(i)
Next
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.