George Boole
InterviewTime limit2sMemory limit512 MB
Read one boolean operation in the form true AND false and print its result.
- Level
Easy1 of 10
- Topics
- Implementation, String, Math, Bit manipulation
- Solved
- No attempts yet
Problem
George Boole was an English mathematician, educator and philosopher, born in 1815. He was the first professor of mathematics at Queen's College, Cork (now University College Cork, UCC), and he is known as the inventor of boolean arithmetic, the field that today's computers are built on.
Boolean arithmetic has no infinite supply of numbers. It has exactly two values: 0 and 1, true and false, yes and no. This problem uses true and false. The two most common operations in boolean arithmetic are AND and OR.
An AND operation gives true only when both values are true.
true AND true = truetrue AND false = falsefalse AND false = false
An OR operation gives true when at least one of the values is true.
true OR true = truefalse OR false = falsefalse OR true = true
Read one such operation and print the correct result.
Input
Read a single line from standard input. The line contains three words in the format value1 operation value2.
Both value1 and value2 are either true or false. The field operation is either AND or OR.
Output
Print the result of the operation, either true or false, on one line.