是要平方的和啊~不是阶乘的和
追答额。失误,下面是改好的,丢脸啊
#include
using namespace std;int main(){ int fuction(int x); int n; cout>n; fuction(n); cout<<"从1的平方到"<<n<<"的平方的和为:"<<fuction(n)<<endl; system("pause"); return 0;}int fuction(int x){ if(x<=0){cout<<"data error"<<endl;return -1;} else if(x==1)return 1; else return x*x+fuction(x-1);}