我想编程序输出实现如下图:
1 2 3 4 5 6 7 8 9
2 3 4 5 6 7 8 9 1
3 4 5 6 7 8 9 1 2
4 5 6 7 8 9 1 2 3
5 6 7 8 9 1 2 3 4
6 7 8 9 1 2 3 4 5
7 8 9 1 2 3 4 5 6
8 9 1 2 3 4 5 6 7
9 1 2 3 4 5 6 7 8请解答,谢谢。

解决方案 »

  1.   

    public class SimpleJava { public void printSimple() {
    for (int i = 1; i <= 9; i++) { for (int j = i; j <= 9; j++) {
    System.out.print(j + " ");
    }
    for (int k = 1; k < i; k++) {
    System.out.print(k + " ");
    }
    System.out.println();
    }
    } public static void main(String[] args) {
    SimpleJava test = new SimpleJava();
    test.printSimple();
    }
    }
      

  2.   


    public class SimpleJava { public void printSimple() {
    for (int i = 1; i <= 9; i++) { for (int j = i; j <= 9; j++) {
    System.out.print(j + " ");
    }
    for (int k = 1; k < i; k++) {
    System.out.print(k + " ");
    }
    System.out.println();
    }
    } public static void main(String[] args) {
    SimpleJava test = new SimpleJava();
    test.printSimple();
    }
    }
      

  3.   

    public class java1 { /**
     * @param args
     */
    public static void main(String args[]){ 
    for(int x=0;x<9;x++)
    {
    for(int y=0;y<9;y++)
    System.out.print((x+y)%9+1);
    System.out.println();
    } }
    }
      

  4.   


    public class java1 { /**
     * @param args
     */
    public static void main(String args[]){ 
    for(int x=0;x<9;x++)
    {
    for(int y=0;y<9;y++)
    System.out.print((x+y)%9+1);
    System.out.println();
    } }
    }
      

  5.   

    for (int x = 0; x < 9; x++) {
    for (int y = 0; y < 9; y++)
    System.out.print((x + y) % 9 + 1 + " ");
    System.out.println();
    }
      

  6.   

    public class Test{
     public static void main(String[] args) {
      for(int i=0;i<=8;i++){
      for(int j=i;j<=8+i;j++){
      System.out.print((j%9+1));
      }
      System.out.println("");
      
        }
    }
    }
      

  7.   

    (x+y)%9+1这个看不懂。
    如果 x =4 Y是多少? x+y%9 是多少
      

  8.   

    挺简单的一道题我用了三个FOR但是第三个FOR我包含在第二个里的。。学习了