赞
踩
- package com.interview07;
-
- /**
- * Copyright (C), 2018-2021
- * FileName: Demo2
- * Author: kongfanyu
- * Date: 2021/3/10 19:10
- * 对1234四个数排列组合成无序且不重复的三位数
- */
- public class Demo2 {
- public static void main(String[] args) {
- int line = 0;
- for (int i = 1; i <=4 ; i++) {
- for (int j = 1; j <=4 ; j++) {
- for (int k = 1; k <=4 ; k++) {
- if ( i!= j && j != k && i != k ) {
- if(j != i + 1 || k != j + 1 ) {
- line++;
- System.out.println("" + i + j + k + "\t");
- if (line % 5 == 0) {
- System.out.println();
- }
- }
- }
- }
- }
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。