There are 1, 2, 3, and 4 numbers. How many different three-digit numbers can be formed without repeated numbers? How many are they?
public class Example11 {
public static void main(String[] args) {
number();
}
public static void number() {
int count = 0;
for (int x = 1; x < 5; x++) {
for (int y = 1; y < 5; y++) {
for ( int z=1; z
System.out.print (Number+"\ T");
Count ++;
if (count % 10 == 0) {
System.out.println ();
}
System.out.println("\nTotal " + count + "three-digit numbers"); ##
The above is the detailed content of Share a classic question in Java. For more information, please follow other related articles on the PHP Chinese website!