Max of 3 Numbers

题目:

Given 3 integers, return the max of them.

分析:

解法:

public class Solution {
    /**
     * @param num1 an integer
     * @param num2 an integer
     * @param num3 an integer
     * @return an integer
     */
    public int maxOfThreeNumbers(int num1, int num2, int num3) {
        // Write your code here
        return Math.max(num1, Math.max(num2, num3) );
    }
}

results matching ""

    No results matching ""