zoukankan      html  css  js  c++  java
  • 有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?

     1     public static void main(String[] args) {
     2         int count = 0;
     3         for( int i = 1 ; i < 5 ; i++ ) {
     4             for( int j = 1 ; j < 5 ; j++ ) {
     5                 for( int k = 1 ; k < 5 ; k++ ) {
     6                     if( i!=j && j!=k && i!=k) {
     7                         count++;
     8                         System.out.println(i+""+j+""+k);
     9                     }
    10                 }
    11             }    
    12         }
    13         System.out.println("共有"+count+"个不重复的三位数");
    14     }
  • 相关阅读:
    2018CodeM复赛
    poj3683
    bzoj3991
    bzoj2809
    bzoj1001
    bzoj1412
    计蒜之道2018复赛
    HDU2255
    bzoj1010
    bzoj2006
  • 原文地址:https://www.cnblogs.com/archimedes-euler/p/9975799.html
Copyright © 2011-2022 走看看