#123. 数字范围模式判定

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

数字范围模式判定

Number Range Check

Background

Congcong is learning how to determine if a number falls within a specific range based on different conditions.

Problem Description

Given an integer nn and a boolean value outsideModeoutsideMode.

If outsideModeoutsideMode is false, return true if nn is in the range 11 to 1010, inclusive. If outsideModeoutsideMode is true, return true if nn is less than or equal to 11, or greater than or equal to 1010. Otherwise, return false.

Input Format

Input is given from standard input in the following format.

nn outsideModeoutsideMode

Where nn is an integer and outsideModeoutsideMode is a boolean value (true or false).

Output Format

Output is printed to standard output in the following format.

true or false

Sample

5 false
true
11 false
false
11 true
true

Sample Explanation

Sample 1: n=5n=5, outsideMode=falseoutsideMode=\text{false}. Since outsideModeoutsideMode is false, we check if nn is between 11 and 1010. 55 is within this range, so true is returned.

Sample 2: n=11n=11, outsideMode=falseoutsideMode=\text{false}. Since outsideModeoutsideMode is false, we check if nn is between 11 and 1010. 1111 is not within this range, so false is returned.

Sample 3: n=11n=11, outsideMode=trueoutsideMode=\text{true}. Since outsideModeoutsideMode is true, we check if nn is less than or equal to 11 or greater than or equal to 1010. 1111 is greater than or equal to 1010, so true is returned.

Constraints

For all test cases: nn is an integer. outsideModeoutsideMode is a boolean value.