In this exercise, we say that a natural number is balanced if the sum of the digits in even positions is equal to the sum of the digits in odd positions. For instance, 1463 and 48015 are balanced numbers.
Write a function that tells if a natural number @n@ is balanced or not.
| C++ | |
| C | |
| Java | |
| Python | |
|
You only need to submit the required procedure; your main program will be ignored.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:29:32.793Z
© Jutge.org, 2006–2026.
https://jutge.org