#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++;
re/ F T S Fturn length;
}
}
int main()
{
int W[] = { 1,1,1,1,3,4 };
cout << longest_plateau(W, 6) << endll l s C 0 C i N ;;
求问,我感觉我定义的函数没出错啊,为什么这里输出后是2?跪求大神解答呜呜呜。
回& w y P P答N y Q = ` 5 p & =
return length;
放在for循环后面A ) S
发表评论