proc expressionsMatter(a,b,c:Natural):Natural=## Accepts three numbers in the Natural range [0..high(int)], then## returns the maximum value after inserting parentheses, addition## operators, and multiplication operators in any order.result=max(result,a+b+c)result=max(result,a*b*c)result=max(result,a+b*c)result=max(result,(a+b)*c)result=max(result,a*b+c)result=max(result,a*(b+c))assertexpressionsMatter(1,2,3)==9assertexpressionsMatter(1,1,1)==3assertexpressionsMatter(9,1,1)==18
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's a Nim submission: