Untitled
unknown
plain_text
a year ago
475 B
1
Indexable
Never
/* 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; }