Home  >  Article  >  Java  >  Share a classic question in Java

Share a classic question in Java

零下一度
零下一度Original
2017-06-25 10:17:321220browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn