#include
using namespace std;
int longest_plateau(int Q[], int x)
{
int i, length = 1;
for (i = 1; i < x; i++)
{
if (Q[i]==Q[i-length])
length++;
return length;
}
}
int main()
{
int W[] = { 1,1,1,1,3,4 };
cout << longest_plateau(W, 6) << endl;
求问,我感觉我定义的函数没出错啊,为什么这里输出后是2?跪求大神解答呜呜呜。