#131. 手机接听条件判断

    ID: 131 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构

手机接听条件判断

Answer Phone Call

Background

Your phone is ringing, and you need to decide whether to answer it based on the current situation.

Problem Description

Your cell phone rings. Return true if you should answer it. Normally you answer, except in the morning you only answer if it is your mom calling. In all cases, if you are asleep, you do not answer.

Input Format

Input is given from standard input in the following format.

is_morning is_mom is_asleep Three boolean values, indicating whether it is morning, whether it is your mom calling, and whether you are asleep. true means true, false means false.

Output Format

Output is printed to standard output in the following format.

result A boolean value, indicating whether you should answer the phone. true means answer, false means do not answer.

Sample

false false false
true
false false true
false
true false false
false

Sample Explanation

For Sample 1: It's not morning, it's not mom calling, and you are not asleep. According to the rules, you normally answer, so output true. For Sample 2: It's not morning, it's not mom calling, but you are asleep. According to the rules, if you are asleep, you do not answer, so output false. For Sample 3: It's morning, it's not mom calling, and you are not asleep. According to the rules, in the morning you only answer if it's your mom calling, so output false.

Constraints

Time limit: 1 second per test case. Memory limit: 1024 KiB per test case.