#C9692. Concatenate Two Positive Integers and Sum Their Digits
Concatenate Two Positive Integers and Sum Their Digits
Concatenate Two Positive Integers and Sum Their Digits
In this problem, you are provided with an input line containing exactly two values separated by spaces. Your task is to check if both values are positive integers. If they are, concatenate these values (i.e., join their digits together) and calculate the sum of all the digits in the resulting number. If any condition is not met (for example, if there are not exactly two inputs or if any of the inputs is not a positive integer), output the string (\texttt{invalid array}).
inputFormat
The input consists of a single line containing exactly two tokens separated by whitespace. Each token is expected to represent a positive integer.
outputFormat
If the input is valid, output the sum of the digits of the concatenated number. Otherwise, output the string (\texttt{invalid array}).## sample
123 456
21