📄 xt4-11.cpp
字号:
#include <iostream>
using namespace std;
int main()
{int f(int);
int n,s;
cout<<"input the number n:";
cin>>n;
s=f(n);
cout<<"The result is "<<s<<endl;
return 0;
}
int f(int n)
{;
if (n==1)
return 1;
else
return (n*n+f(n-1));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -