Problem1293--统计各位数字之和是5的数

1293: 统计各位数字之和是5的数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现两个函数:一个函数判断给定正整数的各位数字之和是否等于5;另一个函数统计给定区间内有多少个满足上述要求的整数,并计算这些整数的和。 函数接口定义: int is( int number ); void count_sum( int a, int b ); 函数is判断number的各位数字之和是否等于5,是则返回1,否则返回0。 函数count_sum利用函数is统计给定区间[a, b]内有多少个满足上述要求(即令is返回1)的整数,并计算这些整数的和。最后按照格式 count = 满足条件的整数个数, sum = 这些整数的和 进行输出。题目保证0 int is( int number ); void count_sum( int a, int b ); int main() { int a, b; scanf(

Input

整数number,区间整数a,b

Output

整数number,区间整数a,b

Sample Input Copy

104 999

Sample Output Copy

104 is counted.
count = 15, sum = 3720

Source/Category