简答题 偏难
#20160

金字塔

金字塔

未登录也能判分,登录后才会记录
答案与解析
正确答案:<pre class="brush:cpp;toolbar:false">#include &lt;algorithm&gt; #include &lt;cstdio&gt; using namespace std; int n, ans = 0;  // 手动初始化累加器 int main() {     scanf("%d", &amp;n);     for (int i = 1; i &lt;= n; ++i) {         ans += i * i;     }     printf("%d\n", ans);     return 0; }</pre>
这道题暂未补解析。