class Solution { public: /** * 最大乘积 * @param A int整型一维数组 * @param ALen int A数组长度 * @return long长整型 */ long long solve(int* A, int ALen) { // write code here sort(A,A+ALen); return max((long long)A[ALen-1] * A[ALen-2] * A[ALen-3], (long long)A[ALen-1] * A[0] * A[1]); } };