数的阶乘之和

package nothh;

public class mmm {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        //4到1的阶乘之和
        int x = 0;
        int y = 0;
        int z = 4;
        
        while(z>=0)
        {    x = z;
            for(int j = z - 1; j > 0; j--)
            {    
                x = j * x;
                
                
            }
            z--;
            y = x+y;
            
            
       }
        System.out.println(y);
        
        
    }

        
}

结果为33,正确

原文地址:https://www.cnblogs.com/shadowduke/p/4854455.html