请以递归的方式计算1+2+3+4+…+n
哪个朋友能把我解决以下我刚学,不知道怎么做
谢谢
public int passTef(int n) { if (n == 0) { return 0; } else { return n + passTef(n - 1); } }
这么弱智的题目考谁?