#122. 数字6的判断

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

数字6的判断

Number 6 Check

Background

Dawei is currently studying the properties of numbers. He has discovered some interesting characteristics of the number 66 and wants you to help him write a program to determine if two integers satisfy specific conditions related to 66.

Problem Description

The number 66 is a truly great number. Given two integer values, aa and bb, return true if either one is 66. Or if their sum is 66 or their difference's absolute value is 66. Otherwise, return false. Note: The function Math.abs(num) computes the absolute value of a number.

Input Format

The input consists of two integers aa and bb, separated by a space.

aa bb

Output Format

Output true if the conditions are met, otherwise output false.

true or false

Sample

6 4
true
4 5
false
1 5
true

Sample Explanation

  • Sample 1: a=6,b=4a=6, b=4. Since aa is 66, return true.
  • Sample 2: a=4,b=5a=4, b=5. aa is not 66, and bb is not 66. a+b=4+5=96a+b = 4+5 = 9 \neq 6. ab=45=1=16|a-b| = |4-5| = |-1| = 1 \neq 6. So return false.
  • Sample 3: a=1,b=5a=1, b=5. aa is not 66, and bb is not 66. a+b=1+5=6a+b = 1+5 = 6. Since their sum is 66, return true.

Constraints

For all test cases: 1000a,b1000-1000 \le a, b \le 1000 Time limit: 1 second, Memory limit: 1024 KB.