阶乘和

int a = 0, b = 1, d = 1, c = 6, e = 1;   
         for( b = 1; b <= c; b ++)   
         {      
             do     
             {       
                 e = d * e;     d ++;    
             }      
             while( d <= b);   
             a = a + e;      
         }     
         System.out.println ( a );

 

posted @ 2015-10-07 19:45  老趙  阅读(207)  评论(0编辑  收藏  举报