11智能在线
新记
java编程,1+2+3……+n,怎么弄,像昨天那样
如题所述
举报该文章
相关建议 2015-09-21
int f(int n){
if(n==0){
return n;
}else if(n>0){
return f(n-1)+n;
}else{
throw new IllegalArgumentException("n ä¸è½ä¸ºè´");
}
}
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/mpq4p84psfqpvvvsmm.html
其他看法
无其他回答
相似回答
大家正在搜