Ubuntu Pastebin

Paste from paarthri at Fri, 29 Jan 2016 03:21:07 +0000

Download as text
1
2
3
4
5
6
PROBLEM 10: Ascending Numbers

Ascending number: 123, 45, 79, 123567
Descending numbers: 89, 532, 852, 932

Write a program which is given two positive integers n and m and prints the sum of all ascending integers which contain the digits 1, 2, 3, ..., n and have m of fewer digits in them. For example if n is 5 and m is 3 the sum is 1855.
Download as text