[语言月赛 202212] 计算
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给定一个 位整数 ,计算:
- 的各位数字之和;
- 的各位数字之和的平方;
- 的各位数字之和的立方;
例如,当这个三位数是 时:
- 各位数字之和为:;
- 各位数字之和的平方为:;
- 各位数字之和的立方为:。
输入格式
输入只有一行一个三位整数 。
输出格式
输出共三行,第一行为各位数字之和,第二行为各位数字之和的平方,第三行为各位数字之和的立方。
817
16
256
4096
提示
样例 1 解释
各位数字之和为:;
各位数字之和的平方为:;
各位数字之和的立方为:。
数据规模与约定
对于全部的测试点,保证 。
2026~2027上学期初二1小测
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2026-10-26 10:45
- End at
- 2026-10-26 12:15
- Duration
- 1.5 hour(s)
- Host
- Partic.
- 32