method one
Comparative if statement, as follows
Second way
Conditions comparison operator, key line as
c = a> = b a: ? B;
Summary:
The only ternary operator (conditional operator) can be used to obtain two numbers that minimum number or maximum. More concise form.
Three ways
Function method can also get this problem, create a Max function, defined as follows
and then add the main function main, function calls to Max declared
three common methods to stop here friends.