Big Math - 3 Points
As the experienced programmer(s) on board, you've been asked to show
some of the new recruits some of what we do around here.
We had them take a little quiz before asking you, and unfortunately
they're not the brightest group we've ever had. They all need a little
arithmetic review. None of them were able to complete long multiplication!
Yikes!
Your first teaching task will be to write a program to show them how
long multiplication works. Since we do some heavy duty math, let's show
them the work and everything, and the product will be no larger than a 16-bit
signed integer.
Input Format
Each input file might have multiple products.
Each case will have only two lines containing two positive integers A &
B.
(Remember that the product will be no larger than a 16-bit signed integer.)
All sets will end with a -1.
The input file will be called jin11.txt.
Output Format
For each test case output the long multiplication work as:
<A>
x <B>
----------------
<subMultiple1>
<subMultiple2>
...
+ <subMultipleN>
----------------
<--Product--->
Example
Input
2
8
65
123
Output
2
x 8
----
16
65
x 123
------
195
130
+ 65
------
7995