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

Share a classic question in Java

零下一度
Release: 2017-06-25 10:17:32
Original
1266 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template