Algs4-1.1.12以下代码段会打印出什么结果?

1.1.12以下代码段会打印出什么结果?
public  class Test
{
    public static void main(String[] args)
    {
      int[] a=new int[10];
      for (int i=0;i<10;i++)
          a[i]=9-i;
      for (int i=0;i<10;i++)
          a[i]=a[a[i]];
      for (int i=0;i<10;i++)
          System.out.println(i);
     }//end main
}//end class
答:
0
1
2
3
4
5
6
7
8
9

猜你喜欢

转载自www.cnblogs.com/longjin2018/p/9848500.html