#263. 鹦鹉说话惹麻烦判断
鹦鹉说话惹麻烦判断
Parrot Trouble
Background
Dawei has a loud talking parrot. This parrot is very noisy, especially at inappropriate times.
Problem Description
We have a loud talking parrot. The hour parameter is the current hour time in the range . We are in trouble if the parrot is talking and the hour is before or after . Return true if we are in trouble.
Input Format
Input is given from standard input in the following format.
talkinghourWheretalkingis a boolean value (trueorfalse), indicating whether the parrot is talking.houris an integer representing the current hour ().
Output Format
Output is printed to standard output in the following format.
A boolean value,
trueif we are in trouble,falseotherwise.
Sample
true 6
true
true 7
false
false 6
false
Sample Explanation
- Sample 1: The parrot is talking (
true), and the hour is . Since , we are in trouble, so returntrue. - Sample 2: The parrot is talking (
true), and the hour is . Since is not less than and not greater than , we are not in trouble, so returnfalse. - Sample 3: The parrot is not talking (
false), so regardless of the hour, we are not in trouble, so returnfalse.
Constraints
- The
hourparameter is in the range .