.[题目分析]我们用l代表最长平台的长度用k指示最长平台在数组b中的起始位置(下标)用j记住局部平台的起始位置用i指示扫描b数组的下标i从开始依次和后续元素比较若局部平台长度(ij)大于l时则修改最长平台的长度k(l=ij)和其在b中的起始位置(k=j)直到b数组结束l即为所求
void Platform (int b[ ] int N)
//求具有N个元素的整型数组b中最长平台的长度
{l=;k=;j=;i=;
while(i<n)
{while(i<n && b[i]==b[i+]) i++;
if(ij+>l) {l=ij+;k=j;} //局部最长平台
i++; j=i; } //新平台起点
printf(最长平台长度%d在b数组中起始下标为%dlk)
}// Platform
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []