JAVA basic programming exercises program [11 11] seeking not repeat numbers

 

11 program [11] seeking not repeat numbers

Title: 1,2,3,4 figures, the number of other with no repeat of the three-digit numbers can be composed? How much are?

Program analysis: can be filled in one hundred, ten digital bits are 1,2,3,4. Composition before removing all permutations arrangement conditions are not satisfied.

 

cskaoyan Package; 

public class cskaoyan11 { 
	@ org.junit.Test 
	public void UNIQUE () { 
		int COUNT = 0; 

		for (int I =. 1; I <=. 4; I ++) { 
			for (int. 1 = J; J <=. 4 ; J ++) { 
				for (int. 1 = K; K <=. 4; K ++) { 
					!!! IF (I = J = K I && && J = K) { 
						COUNT ++; 
						System.out.println (I + J * 100 K + 10 *); 
					} 
				} 
			} 
		} 

		System.out.println ( "can be composed of" + count + "and no duplicate mutually different three-digit number"); 
	} 
}

 

Guess you like

Origin www.cnblogs.com/denggelin/p/11318808.html