Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148772 杨润东 12序列的第n项 C++ Wrong Answer 0 MS 272 KB 386 2026-02-28 19:27:46

Tests(0/10):


Code:

#include <iostream> using namespace std; int main() { int n; cin >> n; if (n <= 0) { cout << 0 << endl; return 0; } if (n == 1 || n == 2) { cout << 1 << endl; return 0; } long long current = 1; for (int i = 2; i <= n; i++) { current += (i - 1); } cout << current << endl; return 0; }


Run Info:

------Input------
5
------Answer-----
7
------Your output-----
11