• 个人简介

    #include using namespace std; int main(){ int n; cin>>n; int a[n]; a[0]=2; int ar=2; for(int i=1;i<n;i++){ a[i]=a[i-1]+ar; ar++; } cout<<a[n-1]; return 0; }

    头文件单独一行

  • 通过的题目

  • 最近活动

    This person is lazy and didn't join any contests or homework.

题目标签

递推
1
驾轻就熟
1