Untitled
unknown
plain_text
2 years ago
475 B
8
Indexable
/*
needs to be solved
*/
#include <stdio.h>
int main()
{
int n,a,b,sum=0;
scanf("%d %d %d",&n,&a,&b);
for (int i = 1; i <= n; i++)
{
int rem=0;
int temp=i;
while (temp)
{
rem=rem+temp%10;
temp/=10;
}
if (rem>=a && rem<= b)
{
sum=sum+i;
}
}
printf("%d\n",sum);
return 0;
}
Editor is loading...