标签:int i++ clu include stream end mes ios for
#include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n){
int i,s[1001],cnt=0;
for(i=0;i<n;i++){
cin>>s[i];
}
for(i=1;i<n-1;i++){
if(s[i]>s[i+1]&&s[i]>s[i-1]||s[i]<s[i+1]&&s[i]<s[i-1]) cnt++;
}
cout<<cnt<<endl;
}
}
标签:int i++ clu include stream end mes ios for
原文地址:http://www.cnblogs.com/logo-88/p/7912106.html