**
链接:
**http://1.14.136.201/problem.php?cid=1058&pid=1
代码:
#include<iostream>
using namespace std;
main()
{
int m,a[100],count=0;
cin>>m;
for(int i=0;i<m;i++)
{
cin>>a[i];
}
for(int k=1;k<m-1;k++)
{
if(a[k]>a[k-1]&&a[k]>a[k+1])
{
cout<<a[k]<<' ';
count++;
if(count==5)
{count=0;
cout<<endl;
}
}
}
}