2 Star 0 Fork 0

BESTI.IS.JAVA2018/20165202jhs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SumofRecur.java 352 Bytes
一键复制 编辑 原始数据 按行查看 历史
Haisu_20165202 提交于 7年前 . Week4 add
public class SumofRecur {
public static void main(String args[]) {
int n = Integer.parseInt(args[0]);
System.out.println(sum(n));
}
public static int sum(int l) {
int t =1;
if(l==1) {
return 1;
}
else {
for(int i=1;i<=l;i++) {
t=1;
for(int j=1;j<=i;j++) {
t=t*j;
}
}
}
return sum(l-1)+t;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/BESTI-IS-JAVA-2018/20165202jhs.git
git@gitee.com:BESTI-IS-JAVA-2018/20165202jhs.git
BESTI-IS-JAVA-2018
20165202jhs
20165202jhs
master

搜索帮助