#C12954. Even Number of 1s
Even Number of 1s
Even Number of 1s
Given a binary string (a string consisting solely of the characters '0' and '1'), determine whether the number of 1s in the string is even. An empty string should be considered as having zero 1s, which is even. Formally, let \( n \) be the count of '1's in the string. The answer is True if \( n \mod 2 = 0 \) and False otherwise.
Example:
- Input: "1100"; Output: True
- Input: "1101"; Output: False
Your task is to read the input from standard input (stdin) and print your answer to standard output (stdout).
inputFormat
The input consists of a single line containing a binary string. The string may be empty and contains only the characters '0' and '1'.
outputFormat
Output a single line containing either True
or False
, indicating whether the binary string has an even number of 1s.
1100
True