1到20阶乘倒数之和

double a1 = 0 ,b2 = 1;
            int n = 1;
            while( n <= 20 )
            {
                b2 = b2 * n++;
                a1 = a1 + 1 / b2;
            }
            System.out.println(a1);

 

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