#118. 松鼠玩耍判断

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

松鼠玩耍判断

Squirrel Play Judgment

Background

In beautiful Palo Alto, a group of lively squirrels are full of energy every day. They spend most of their time playing, but whether they play depends on the day's temperature and season.

Problem Description

The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is between 6060 and 9090 (inclusive). Unless it is summer, then the upper limit is 100100 instead of 9090.

Given an integer temperature and a boolean isSummer, return true if the squirrels play and false otherwise.

Input Format

Input is given from standard input in the following format.

temperature isSummer

Where temperature is an integer and isSummer is a boolean (true or false).

Output Format

Output is printed to standard output in the following format.

A boolean value (true or false), indicating whether the squirrels play.

Sample

70 false
true
95 false
false
95 true
true

Sample Explanation

Sample 1: Temperature is 7070, and it's not summer. 7070 is between 6060 and 9090, so squirrels play, returning true.

Sample 2: Temperature is 9595, and it's not summer. 9595 is not between 6060 and 9090, so squirrels do not play, returning false.

Sample 3: Temperature is 9595, and it's summer. In summer, the upper limit is 100100. 9595 is between 6060 and 100100, so squirrels play, returning true.

Constraints

Time limit: 11 second, Memory limit: 10241024 KiB for each test case.