[语言月赛202212] 计算

Luogu
IDLGB3685
Time1000ms
Memory128MB
DifficultyP1
2022O2优化顺序结构语言月赛
给定一个 $3$ 位整数 $n$,计算: 1. $n$ 的各位数字之和; 2. $n$ 的各位数字之和的平方; 3. $n$ 的各位数字之和的立方; 例如,当这个三位数是 $123$ 时: 1. 各位数字之和为:$1+2+3=6$; 2. 各位数字之和的平方为:$(1+2+3)^2=(1+2+3)\times (1+2+3)=36$; 3. 各位数字之和的立方为:$(1+2+3)^3=(1+2+3)\times (1+2+3)\times (1+2+3)=216$。 ## Input 输入只有一行一个三位整数 $n$。 ## Output 输出共**三行**,第一行为各位数字之和,第二行为各位数字之和的平方,第三行为各位数字之和的立方。 [samples] ## Note ### 样例 1 解释 各位数字之和为:$8+1+7=16$; 各位数字之和的平方为:$16^2=16\times 16 = 256$; 各位数字之和的立方为:$16^3 =16\times 16\times 16 = 4096$。 ### 数据规模与约定 对于全部的测试点,保证 $100 \leq n \leq 999$。
Samples
Input #1
817
Output #1
16
256
4096
API Response (JSON)
{
  "problem": {
    "name": "[语言月赛202212] 计算",
    "description": {
      "content": "给定一个 $3$ 位整数 $n$,计算: 1. $n$ 的各位数字之和; 2. $n$ 的各位数字之和的平方; 3. $n$ 的各位数字之和的立方; 例如,当这个三位数是 $123$ 时: 1. 各位数字之和为:$1+2+3=6$; 2. 各位数字之和的平方为:$(1+2+3)^2=(1+2+3)\\times (1+2+3)=36$; 3. 各位数字之和的立方为:$(1+2+3)^3=(1+2",
      "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": "LGB3685"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定一个 $3$ 位整数 $n$,计算:\n1. $n$ 的各位数字之和;\n2. $n$ 的各位数字之和的平方;\n3. $n$ 的各位数字之和的立方;\n\n例如,当这个三位数是 $123$ 时:\n\n1. 各位数字之和为:$1+2+3=6$;\n2. 各位数字之和的平方为:$(1+2+3)^2=(1+2+3)\\times (1+2+3)=36$;\n3. 各位数字之和的立方为:$(1+2+3)^3=(1+2...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments