package until4;public class one { public static void main(String[] args) { // TODO Auto-generated method stub for(int i=1;i<=30;i++){ int sum=0; sum=sum+fun(i); System.out.println(sum); } public static int fun(int a){ if(a>1){ return a*fun(a-1); } else return 1; } } }
3 回答
已采纳
think008
TA贡献1条经验 获得超0个赞
package until4; public class one { public static void main(String[] args) { // TODO Auto-generated method stub for(int i=1;i<=30;i++){ int sum=0; sum=sum+fun(i); System.out.println(sum); } } public static int fun(int a){ if(a>1){ return a*fun(a-1); }else return 1; } }
添加回答
举报
0/150
提交
取消