博鳌
幼苗
共回答了20个问题采纳率:85% 举报
用VBA可以解决,比如数据储存与A列到G列:
Sub dadsa ()
Dim a As Byte:Dim b As Byte
Dim c As Byte:Dim d As Byte
Dim e As Byte: Dim f As Byte
Dim g As Byte:Dim n as Integer
For a=0 to 3
For b=a+1 to 4
For c=b+1 to 5
For d=c+1 to 6
For e=d+1 to 7
For f=e+1 to 8
For g=f+1 to 9
n=n+1
Cells(n,1)=a
Cells(n,2)=b
Cells(n,3)=c
Cells(n,4)=d
Cells(n,5)=e
Cells(n,6)=f
Cells(n,7)=g
Next
Next
Next
Next
Next
Next
Next
End Sub
这个程序得出的结果是:
0 1 2 3 4 5 6
0 1 2 3 4 5 7
0 1 2 3 4 5 8
0 1 2 3 4 5 9
1 2 3 4 5 6 7
1 2 3 4 5 6 8
1 2 3 4 5 6 9
2 3 4 5 6 7 8
2 3 4 5 6 7 9
3 4 5 6 7 8 9
这是按升序排列的,如果你要混乱顺序的话,原理一样,将a-g7个数编入一个数组,随机填入即可。
1年前
8