Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138512 向俊麒 求序列的前n项和 C++ Wrong Answer 0 MS 276 KB 434 2025-11-25 19:12:23

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a=2,b=1,a2=3,b2=2,n,h=0; cin>>n; for(int i=1;i<=n;i++){ h=b+a; a2=a2+1; a=a+a2; b2=b2+1; b+b2; }cout<<h; return 0; }


Run Info:

------Input------
3
------Answer-----
5.16667
------Your output-----
12