高分求一个java代码!
要求输出的结果是这个样子的: 
 555555555 
 544444445 
 543333345 
 543222345 
 543212345 
 543222345 
 543333345 
 544444445 
 555555555 
 算法越优秀越好,算法能给出来越多越好。谢谢!要求给出全部java代码。
------解决方案--------------------想学好java,这么简单的东西应该自己写,就是一个劲的输出,结果不对就重来,等结果输出全对了,在看算法,有没有更简单的,慢慢的优化...只有不段的动手实践才能不断的提高.
------解决方案--------------------刚才电脑死机了!!   
 public static void main(String[] args) { 
   final int NUM = 5; 
   for (int i = 0 - (NUM - 1); i  < NUM; i++) { 
     for (int j = 0 - (NUM - 1); j  < NUM; j++) { 
       boolean b = Math.abs(i) > = Math.abs(j); 
       System.out.print(b?Math.abs(i)+1:Math.abs(j)+1); 
     } 
     System.out.println(); 
   } 
 } 
------解决方案--------------------像做这种有图形对称的题目,循环由负到正做起来较为简单。
------解决方案--------------------以前看到有个java面试题,问2*8怎么计算最快,标准答案是2 < <3,我还奇怪呢,为什么不是8 < <1呢? 
 实际上,因为2和8都是已知的,还是直接写一个16最快。 
 带星的专家就是有专家风范! 
 向“逍遥”致敬!
------解决方案--------------------Math中的几个方法: 
 abs(double a)  
           返回 double 值的绝对值。  
  abs(float a)  
           返回 float 值的绝对值。  
 abs(int a)  
           返回 int 值的绝对值。  
 abs(long a)  
           返回 long 值的绝对值。  
------解决方案--------------------写了一个  每三楼的好  LZ参考 一下 
 public class Untitled1 {   
 public static int [] shuchu(int n,int [] c) 
   { 
  // int[] c={5,5,5,5,5,5,5,5,5};   
   int i=0; 
   if(n==0) 
   { 
 return(c); 
   } 
   else 
   { 
      c=shuchu(n-1,c); 
      if(n <5) { 
  for(i=5-Math.abs(n-5);i <4+Math.abs(n-5);i++) 
     { 
       c[i]=Math.abs(5-n); 
    } 
    i=0; 
   } 
   else{ 
    for(i=5-Math.abs(n-4);i <5+Math.abs(n-4);i++) 
      c[i]=Math.abs(n-3); 
 i=0; 
   }     
  return(c); 
   }   
   } 
    public static void main(String[] args) { 
     int[] c={5,5,5,5,5,5,5,5,5};   
     int i=9; 
     int j=0; 
     int [] d=new int[9]; 
     for(i=0;i <9;i++) 
     { 
     while(j <9) 
   { 
     d=shuchu(i,c); 
     System.out.print(d[j]); 
   j++; 
   } 
   System.out.println() ; 
   j=0; 
     } 
   } 
    }