Page not loading? Try clicking here.
Placeholder

#1291

Multiplication Table 1s 64MB

Problems

Write a program that receives the desired range of multiplication tables and prints the multiplication tables for that interval.

[Processing Conditions]

(1) Receive the starting number and the ending number of the interval.

(2) The entered interval does not necessarily require that the first input value be smaller than the last input value.
 That is, the multiplication tables must be printed in the same increasing or decreasing order as the entered interval.


Input

Receive the starting range s and the ending range e of the multiplication table.

  • s and e must be integers between 2 and 9, and if an entered value is outside the given range, print INPUT ERROR! and receive s and e again.

  • Input may be given multiple times.

After one result is printed, the program terminates.


Output

Print the multiplication tables between the starting range and the ending range, and separate all numbers and operators with spaces.
They must be aligned as shown in the output example.

Separate each multiplication table with three spaces.


Example #1

3 4
3 * 1 =  3   4 * 1 =  4
3 * 2 = 6 4 * 2 = 8
3 * 3 = 9 4 * 3 = 12
3 * 4 = 12 4 * 4 = 16
3 * 5 = 15 4 * 5 = 20
3 * 6 = 18 4 * 6 = 24
3 * 7 = 21 4 * 7 = 28
3 * 8 = 24 4 * 8 = 32
3 * 9 = 27 4 * 9 = 36

Example #2

1 6
11 5
9 6
INPUT ERROR!
INPUT ERROR!
9 * 1 = 9 8 * 1 = 8 7 * 1 = 7 6 * 1 = 6
9 * 2 = 18 8 * 2 = 16 7 * 2 = 14 6 * 2 = 12
9 * 3 = 27 8 * 3 = 24 7 * 3 = 21 6 * 3 = 18
9 * 4 = 36 8 * 4 = 32 7 * 4 = 28 6 * 4 = 24
9 * 5 = 45 8 * 5 = 40 7 * 5 = 35 6 * 5 = 30
9 * 6 = 54 8 * 6 = 48 7 * 6 = 42 6 * 6 = 36
9 * 7 = 63 8 * 7 = 56 7 * 7 = 49 6 * 7 = 42
9 * 8 = 72 8 * 8 = 64 7 * 8 = 56 6 * 8 = 48
9 * 9 = 81 8 * 9 = 72 7 * 9 = 63 6 * 9 = 54


Source

JUNGOL

You must sign in to write code.