Triangular Number

AtCoder
IDabc435_a
Time2000ms
Memory256MB
Difficulty
You are given a positive integer $N$. Output the sum of all integers from $1$ to $N$, that is, $1+2+\cdots+N$. ## Constraints * $1 \leq N \leq 100$ * $N$ is an integer. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
5
Output #1
15

Since $1+2+3+4+5=15$, output $15$.
Input #2
1
Output #2
1
Input #3
29
Output #3
435
API Response (JSON)
{
  "problem": {
    "name": "Triangular Number",
    "description": {
      "content": "You are given a positive integer $N$.   Output the sum of all integers from $1$ to $N$, that is, $1+2+\\cdots+N$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc435_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a positive integer $N$.  \nOutput the sum of all integers from $1$ to $N$, that is, $1+2+\\cdots+N$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $N$ is an integer.\n\n## Input\n\nThe input is...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments