#C8654. Multiply Strings Without Conversion
Multiply Strings Without Conversion
Multiply Strings Without Conversion
You are given two non-negative integers num1
and num2
represented as strings. Your task is to compute the product of these two numbers and return it as a string.
Important: You must not convert the input strings directly into integers or use any built-in big integer library. Instead, simulate the multiplication process similar to the manual multiplication algorithm.
For example, when multiplying "123"
by "456"
, the expected output is "56088"
.
The input is provided via standard input (stdin) and the output should be written to standard output (stdout).
inputFormat
The input consists of two lines. The first line contains the string num1
and the second line contains the string num2
.
Both strings represent non-negative integers and may include multiple digits.
outputFormat
Output a single line containing the product of num1
and num2
as a string.
2
3
6