初学JAVA,请教下各位大神图上的第六题,如何利用while或者do while计算5的阶乘,谢谢

2025-03-24 19:54:39
推荐回答(1个)
回答1:

public class Test{ public static void main(String[] args){ int x = 1; //用于求每个数的阶层 int count = 0,sum = 0; //用于统计1 - 10 阶层的和 int[] m = new int[10]; //用于保存每个阶层的结果,可以自己去打印 //对于这里,没什么好解...