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,正确
时间: 2024-11-03 22:07:32