{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "784938343cda4c629b52000ba7981f24",
  "keywords": "数学运算",
  "title": "计算第n项的值",
  "desc": [
    {
      "content": "\n计算 s=(1+1)+(1+2)+(1+2+3)+````+(1+2+3+...+n) 第n项的值",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <iostream>\nusing namespace std;\nint main()\n{\n\tint n; \n\tstatic int\tsum=1;\n\tcout << \"请输入N：\" << endl;\n\tcin >> n;\n\tfor (int i = 1; i <= n; i++)\n\t{\n\t\tfor (int j = 1; j <= i; j++)\n\t\t{\n\t\t\tsum = sum + j;\n\t\t}\n\t}\n\tcout << \"结果为：\" << sum;\n\tsystem(\"pause\");\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-5b71b02dd5694fccae63bdaaa74c208c",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600469946"
}