The Seven Ways to Say Yes
Halloway Media keeps a newsletter opt-in flag that four different signup forms have written to over ten years. People who opted in are recorded as yes, Y, TRUE or 1; people who did not are recorded as no, N, false or 0; and any of those may arrive in any mixture of capitals. Before the column can be used for anything it has to say exactly one of two things.
Task: Print the normalised flag for each value.
Input
The first line holds one integer n, how many flags follow. Most of the next n lines hold one flag spelled as one of yes, y, true, 1, no, n, false or 0, in any combination of upper and lower case. A line may also hold something the forms never meant to write — a stray word, a digit other than 1 or 0, or nothing at all. Only the four opted-in spellings count as opted in; every other line, recognised or not, counts as not opted in.
Output
n lines in the same order, each holding the lowercase word true or false.
Example:
Input:
4
yes
FALSE
Y
0
Output:
true
false
true
false
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in