Your task is to write a program that, given two natural numbers and , uses to print a valley with rows as it is shown at the instances. Notice that, the last row has numbers separated by dashes, the central dot, and numbers separated by dashes, that each row has two numbers less than the row immediataly below, and that the part of the middle has to be filled with as many dots as necessary.
To solve this problem, you must implement recursively the function
int number_of_digits(int n);
that returns the number of digits of |n|, under the precondition |n| .
The input consists of two natural numbers and , with .
Your program must print a valley of rows using the number as can be seen in the instances.
Using strings is not allowed. Obviously, you can not use vectors either.
Remember to implement |number_of_digits(n)| recursively.
Input
10004 3
Output
10004.........................10004 10004-10004.............10004-10004 10004-10004-10004.10004-10004-10004
Input
0 6
Output
0.....................0 0-0.................0-0 0-0-0.............0-0-0 0-0-0-0.........0-0-0-0 0-0-0-0-0.....0-0-0-0-0 0-0-0-0-0-0.0-0-0-0-0-0
Input
987654321 1
Output
987654321.987654321