#296. 根据条件判断两数正负
根据条件判断两数正负
Conditional Check
Background
Dawei is writing a program that needs to determine the positivity/negativity of two numbers based on certain conditions.
Problem Description
Given two integer values, return true if one is negative and one is positive. Except if the parameter is true, then return true only if both are negative.
Input Format
Input is given from standard input in the following format.
a b negative
Output Format
Output is printed to standard output in the following format.
result
Sample
1 -1 false
true
-1 1 false
true
-4 -5 true
true
Sample Explanation
Sample 1: Input is . Since is false, and is positive while is negative, the condition "one is negative and one is positive" is met, so true is returned.
Sample 2: Input is . Since is false, and is negative while is positive, the condition "one is negative and one is positive" is met, so true is returned.
Sample 3: Input is . Since is true, and both and are negative, the condition "both are negative" is met, so true is returned.
Constraints
Time limit: 1 second, Memory limit: 1024 KiB for each test case.