public class num {
static int k = 0;
public static void main(String[] args) {
// 第n
int a[] = new int[33];
for (int b = 0; b < 33; b++) {
a[b] = b + 1;
}
permutations(a, 0, 5);
}
public static void permutations(int[] a, int m, int n) {
if (m == n) {
k++;
System.out.println("第" + k + "组:");
for (int j = 1; j <= 11; j++) {
System.out.println("前6位数");
for (int i = 0; i <= n; i++) {
System.out.print( a[i]+" " );
}
System.out.print("第7位数:"+j+"n");
}
System.out.println();
} else {
for (int i = 0; i < 33; i++) {
int temp = a[m];
a[m] = a[i];
a[i] = temp;
permutations(a, m + 1, n);
temp = a[m];
a[m] = a[i];
a[i] = temp;
}
}
}
}
手机观看扫描下方微信小程序二维码
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。
暂无评论
要发表评论,您必须先 登录