求 1+2+3+...+N 的值

Luogu
IDLGB2142
Time1000ms
Memory128MB
DifficultyP1
函数与递归
用递归的方法求 $1+2+3+$ …… $+N$ 的值。 ## Input 输入 $N$。 ## Output 输出和。 [samples] ## Note $N\le 200$
Samples
Input #1
5
Output #1
15
API Response (JSON)
{
  "problem": {
    "name": "求 1+2+3+...+N 的值",
    "description": {
      "content": "用递归的方法求 $1+2+3+$ …… $+N$ 的值。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB2142"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "用递归的方法求 $1+2+3+$ …… $+N$ 的值。\n\n## Input\n\n输入 $N$。\n\n## Output\n\n输出和。\n\n[samples]\n\n## Note\n\n$N\\le 200$...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments