以下代码 :如何 输出 123456789

public class Beijing2 {
    public static void main(String[] args) throws IOException {

        for (int i = 0; i < 10; i++) {

            for (int j= 1; j < 10; j++) {

                System.out.print(j);

            }
            System.out.println();
        }

    }
}
public class Beijing2 {
    public static void main(String[] args) throws IOException {

        for (int i = 0; i < 10; i++) {

            for (int j= 1; j < 10; j++) {
                        if (j == 9 && i != 9)
                System.out.print(i + 1);

            }
            //System.out.println();
        }

    }
}

一个循环输出即可,类似如下:

public class Beijing2 {
    public static void main(String[] args) throws IOException {
        for (int j= 1; j < 10; j++) {

            System.out.print(j);

        }

}