Professional Documents
Culture Documents
Balance number
The balance number is a 4-digit number, where the sum of the first two digits is equal to the sum of
the remaining two digits.
Creates a program that allows user enter a 4-digit positive integer, and checks if it's a balance number
or not a balance number.
Input
The input starts with an integer N (1000 ≤ N ≤ 9999).
Output
Prints “Yes” since N is a balance number, otherwise print “No”.
Sample
Sample Input 1 Sample Output 1
1000 No
Creates a program that allows user entering a name and removes all consecutive duplicate characters.
Input
The input contains a single name that contains only lowercase letters (a–z), no white space. The length
of name is from 1 to 250 characters.
Output
The normalized name.
Sample
Sample Input 1 Sample Output 1
robert robert