public static String show ( int n )
   {
      String s3="";
      if ( n == 1 )
        return "1";
      if(n>1)      
         s3 = ""+n + "+"+show ( n - 1 );
      
      return s3;
   }

解决方案 »

  1.   

    and according to your algo, output is like this
    1=1
    3=2+1
    6=3+2+1
    ...To get the order as 6=1+2+3, just let:s3 = show ( n - 1 )+"+"+n;
      

  2.   

    不行啊,只要java Test2
    光标就一直闪,什么反映都没有啊!!!
    编译都通过了,怎么办啊,救救小弟!
      

  3.   

    use the following show() to replace your original show() method. I've tested, it works.public static String show ( int n )
       {
          String s3="";
          if ( n == 1 )
            return "1";
          if(n>1)      
             s3 = show ( n - 1 )+"+"+n;
          
          return s3;
       }