从1到9任意9个数字的所有排列组合共有多少种(不重复)
2个回答
展开全部
以下为代码及关键注释(请慎用,数据量巨大,电脑一直会在后台计算,如果数据超过65565*250,则会出错)
sub
main()
for
i1
=
1
to
9:
for
i2
=
1
to
9:
for
i3
=
1
to
9:
for
i4
=
1
to
9:
for
i5
=
1
to
9:
for
i6
=
1
to
9:
for
i7
=
1
to
9:
for
i8
=
1
to
9:
for
i9
=
1
to
9
if
i1
+
i2
+
i3
+
i4
+
i5
+
i6
+
i7
+
i8
+
i9
<
37
then'判断条件,9个数之后小于等于36
k
=
k
+
1
cells(int((k
-
1)
/
250)
+
1,
(k
-
1)
mod
250
+
1)
=
i1
&
i2
&
i3
&
i4
&
i5
&
i6
&
i7
&
i8
&
i9'实现每行存放250个数据
end
if
next:
next:
next:
next:
next:
next:
next:
next:
next
end
sub
sub
main()
for
i1
=
1
to
9:
for
i2
=
1
to
9:
for
i3
=
1
to
9:
for
i4
=
1
to
9:
for
i5
=
1
to
9:
for
i6
=
1
to
9:
for
i7
=
1
to
9:
for
i8
=
1
to
9:
for
i9
=
1
to
9
if
i1
+
i2
+
i3
+
i4
+
i5
+
i6
+
i7
+
i8
+
i9
<
37
then'判断条件,9个数之后小于等于36
k
=
k
+
1
cells(int((k
-
1)
/
250)
+
1,
(k
-
1)
mod
250
+
1)
=
i1
&
i2
&
i3
&
i4
&
i5
&
i6
&
i7
&
i8
&
i9'实现每行存放250个数据
end
if
next:
next:
next:
next:
next:
next:
next:
next:
next
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询