#138. 条件判断三数递增性
条件判断三数递增性
Check Increasing Sequence
Background
This is a small problem about determining the order of a sequence of numbers.
Problem Description
Given three integers and a boolean equalOk, return true if they are in strict increasing order, such as , or , but not or .
However, if equalOk is true, equality is allowed, such as or should also return true.
Input Format
Input is given from Standard Input in the following format.
a b c equalOk
Where are integers, and equalOk is a boolean value (true or false).
Output Format
Output is printed to Standard Output in the following format.
trueorfalse
Sample
2 5 11 false
true
5 7 6 false
false
5 5 7 true
true
Sample Explanation
Sample 1: , and equalOk is false, which satisfies strict increasing order, so true is returned.
Sample 2: but , which does not satisfy strict increasing order, so false is returned.
Sample 3: , and equalOk is true, which satisfies non-decreasing order, so true is returned.
Constraints
Time limit: 1 second, Memory limit: 1024 KiB for each test case.