Home > Java > javaTutorial > body text

Java classic programming questions--ninety-nine multiplication tables

零下一度
Release: 2017-06-25 10:23:03
Original
1823 people have browsed it

输出九九乘法表。

public class Example16 {
    public static void main(String[] args) {
        table(9);
    }

    public static void table(int n) {
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + j * i+"\t");
            }
            System.out.println();
        }
    }
}

The above is the detailed content of Java classic programming questions--ninety-nine multiplication tables. 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