Given three numbers N,A, B. Print the summation of the numbers between 1 and N whose sum of digits is between A and B inclusive. Input Only one line containing three numbers N, A, B (1 5 N s 10“, 1 5 ASBS 36). Output Print a single line contains the answer according to the required above. Eхamples

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question

Write a program in C++

Given three numbers N,A, B. Print the summation of the numbers between 1 and N whose sum of digits
is between A and B inclusive.
Input
Only one line containing three numbers N, A, B (1<N< 104,1<A<B< 36).
Output
Print a single line contains the answer according to the required above.
Examples
Input
20 2 5
Output
84
Input
10 1 2
Output
13
Input
100 4 16
Output
4554
Note
In the first simple:
Among the numbers not greater than 20, the numbers whose sums of digits are between 2 and 5, are:
2,3,4,5,11,12,13,14 and 20.
So the answer is: 84.
Transcribed Image Text:Given three numbers N,A, B. Print the summation of the numbers between 1 and N whose sum of digits is between A and B inclusive. Input Only one line containing three numbers N, A, B (1<N< 104,1<A<B< 36). Output Print a single line contains the answer according to the required above. Examples Input 20 2 5 Output 84 Input 10 1 2 Output 13 Input 100 4 16 Output 4554 Note In the first simple: Among the numbers not greater than 20, the numbers whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. So the answer is: 84.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT