实现有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?

public class Test_A23 {
public static void main(String[] args){
    int count=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 &&i!=k && j!=k){
                    int number=i*100+j*10+k;
                    System.out.print(" "+number);
                    count++;
                }

            }
        }
    }
    System.out.println();
    System.out.println("共有"+count+"个符合条件的三位数");
}


}

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-14 23:04:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-14 23:04:04       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-14 23:04:04       82 阅读
  4. Python语言-面向对象

    2024-06-14 23:04:04       91 阅读

热门阅读

  1. C++中的备忘录模式

    2024-06-14 23:04:04       33 阅读
  2. c++ 函数内对象的释放

    2024-06-14 23:04:04       30 阅读
  3. 深入浅出谈C/C++中static关键字

    2024-06-14 23:04:04       27 阅读
  4. 【总结】项目中用过的设计模式

    2024-06-14 23:04:04       30 阅读
  5. 从零开始精通Onvif之事件处理

    2024-06-14 23:04:04       31 阅读
  6. Codeforces Global Round 26 题解分享

    2024-06-14 23:04:04       32 阅读
  7. 嵌套字典结构

    2024-06-14 23:04:04       34 阅读
  8. jQuery前景以及优劣势

    2024-06-14 23:04:04       29 阅读
  9. 2024年超实用的独立站Dropshipping工具分享!

    2024-06-14 23:04:04       35 阅读