Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
111718 | 陈皓轩 | 13求1+2-3+4-5+……n的值 | C++ | Wrong Answer | 0 MS | 268 KB | 348 | 2025-03-03 21:16:42 |
#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 n,i,s=0; for(i=1;i<=n;i++) { s+=i+(i+1)-i+2; } return 0; }
------Input------
157
------Answer-----
-77
------Your output-----