Put rice cookers

int is( int n)
{
    int s=0,t=0;
while(n!=0){
t=n%10;
n/=10;
s+=t;
}
if(s==5)
return 1;
else
return 0;
}
void count_sum( int a, int b )
{
int sum=0,count=0,i;
for(i=a;i<=b;i++){
if(is(i)){
count++;
sum+=i;
}
}
printf("count = %d, sum = %d\n",count,sum);
}    

Guess you like

Origin www.cnblogs.com/tongyingjun/p/11993546.html