求出 e 的值

Luogu
IDLGB2079
Time1000ms
Memory128MB
DifficultyP1
循环结构
利用公式 $e=1+1/1!+1/2!+1/3!+ \cdots +1/n!$,求 $e$ 的值,要求保留小数点后 $10$ 位。 ## Input 输入只有一行,该行包含一个整数 $n$,表示计算 $e$ 时累加到 $1/n!$。 ## Output 输出只有一行,该行包含计算出来的 $e$ 的值,要求打印小数点后 $10$ 位。 [samples] ## Note $2 \le n \le 15$。
Samples
Input #1
10
Output #1
2.7182818011
API Response (JSON)
{
  "problem": {
    "name": "求出 e 的值",
    "description": {
      "content": "利用公式 $e=1+1/1!+1/2!+1/3!+ \\cdots +1/n!$,求 $e$ 的值,要求保留小数点后 $10$ 位。",
      "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": "LGB2079"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "利用公式 $e=1+1/1!+1/2!+1/3!+ \\cdots +1/n!$,求 $e$ 的值,要求保留小数点后 $10$ 位。\n\n## Input\n\n输入只有一行,该行包含一个整数 $n$,表示计算 $e$ 时累加到 $1/n!$。\n\n## Output\n\n输出只有一行,该行包含计算出来的 $e$ 的值,要求打印小数点后 $10$ 位。\n\n[samples]\n\n## Note\n\n$2 \\le ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments