Related sum of the halves of a number

Given a non-negative integer n, compute the sum of the digits in the
first and in the second halves of n. Your program must also indicate the
order relationship among those quantities. This computation has to be
done only when the number of digits of n is even.

 
The first half of a number with l digits (for even l) is formed by the
$\frac{l}{2}$ left digits and the second half is formed by the
$\frac{l}{2}$ right digits. For example, the number 70724444, has first
half 7072 and second half 4444.

Input

The input is a non-negative integer n with 0 ≤ n < 2³¹.

Output

The sum of the digits of the first half and the sum of the digits of the
second half together with their relationship, provided that the number
of digits is even.

 
Follow the format of the examples.

Problem information

Author: Unknown
Translator: Maria J. Serna

Generation: 2026-01-25T16:47:02.677Z

© Jutge.org, 2006–2026.
https://jutge.org
