标签:自己 i++ div xxx turn int bsp lan lang
1.编写一个程序,求1!+2!+…+10!的值。
package xxx; public class abc { public static void main(String args[]) { int[] a = {1,2,3,4,5,6,7,8,9,10}; int a_sum = 0; for(int i=0; i < a.length; i++) { a_sum+=jieCheng(a[i]); } System.out.print(a_sum); } public static int jieCheng(int a1) { int re=1; for(int j=1; j<=a1; j++) { re*=j; } return re; } }
标签:自己 i++ div xxx turn int bsp lan lang
原文地址:https://www.cnblogs.com/sakuraXiYue/p/9693830.html