#186. 检查整数是否包含数字1

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

检查整数是否包含数字1

Check for Digit 1

Background

Congcong is currently studying number properties. He wants to know if a positive integer contains the digit 11.

Problem Description

Given a positive integer nn, return true if its decimal representation contains the digit 11; otherwise, return false.

Hint: You can use the modulo operator % to get the rightmost digit, and the division operator // to discard the rightmost digit.

Input Format

Input is given from Standard Input in the following format.

A positive integer nn.

Output Format

Output to Standard Output in the following format.

Output true if nn contains the digit 11; otherwise, output false.

Sample

10
true
22
false
220
false

Sample Explanation

  • Sample 1: 1010 contains the digit 11, so output true.
  • Sample 2: 2222 does not contain the digit 11, so output false.
  • Sample 3: 220220 does not contain the digit 11, so output false.

Constraints

1n1091 \le n \le 10^9