#186. 检查整数是否包含数字1
检查整数是否包含数字1
Check for Digit 1
Background
Congcong is currently studying number properties. He wants to know if a positive integer contains the digit .
Problem Description
Given a positive integer , return true if its decimal representation contains the digit ; 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 .
Output Format
Output to Standard Output in the following format.
Output
trueif contains the digit ; otherwise, outputfalse.
Sample
10
true
22
false
220
false
Sample Explanation
- Sample 1: contains the digit , so output
true. - Sample 2: does not contain the digit , so output
false. - Sample 3: does not contain the digit , so output
false.
Constraints