【简答题】
用递归法求从1到n的立方和:#include <iostream> using namespace std; int f(int); int main(){ int n,s; cout<<"input the number n:"; cin>>n; s= ________ ; cout<<"The result is "<<s<<endl; return 0; } int f(int n){ //递归法求立方和函数 if ( n==1 ) return 1; else return ________; }
举报
参考答案:
参考解析:
举一反三