Maximum Ride

# What is the max power for the move return?

**We need you to answer this question!**

###### If you know the answer to this question, please register to join our limited beta program and start the conversation right now!

## Related Questions

###### Asked in C++ Programming

### How do you write an algorithm to find the largest of three numbers?

The simplest algorithm employs a function to find the largest of
two values. The return value can then be input to the same function
along with the third value to determine the largest of three
values:
// return largest of 2 values
int max(int a, int b) {return a<b?b:a;}
// return largest of 3 values
int max(int a, int b, int c) {return max(max(a,b),c);}
The function can be overloaded to cater for any number of values
simply by calling the previous overload:
// return largest of 4 values
int max(int a, int b, int c, int d) {return
max(max(a,b,c),d);}
Although you can provide as many overloads as desired, it would
be simpler to use an overload that accepts a vector of values:
int max(std::vector<int>& v)
{
if (v.empty())
throw std::range_error("max(std::vector<int>&): range
error!");
int m = v[0];
for (size_t i=1; i<v.size(); ++i) m=max(m,v[i]);
return m;
}