62,614
社区成员
发帖
与我相关
我的任务
分享
public class App {
private static int count;
public static int f(int x){
if(x == 0){
return 0;
}else{
count++;
return 2 * f(x - 1) + x * x;
}
}
public static void main(String[] args) {
System.out.println(f(3) + " c " + count);
}
}