#P42. 数位累加和
数位累加和
Description
给定一个 整数n,输出这个数的位数和数位累加和。
Input Format
一个整数。
Output Format
第一行一个整数表示其位数 第二行一个整数表示其各个数位累加和。
Sample
input
123
output
3
6
Hint
保证。
时间限制:
空间限制:
给定一个 整数n,输出这个数的位数和数位累加和。
一个整数。
第一行一个整数表示其位数 第二行一个整数表示其各个数位累加和。
input
123
output
3
6
保证n≤2∗109。
时间限制:1s
空间限制:256MB
By signing up a code-fans universal account, you can submit code and join discussions in all online judging services provided by us.