每日打卡1112
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,t,c[10005],a,b,x=0,k=0;
cin>>n>>t;
for(i=0;i<n;i++)
{cin>>c[i];
if(c[i]>x)x=c[i];
}
for(i=0;i<n;i++){
if(c[i]>t&&c[i-1]<=t)a=i;
if(c[i]>t&&c[i+1]<=t){
b=i;
cout<<"["<<a<<", "<<b<<"]\n";
a=0,b=0;
k=1;
}
}
if(k==0)cout<<x;
return 0;
}
本文来自博客园,作者:赵千万,转载请注明原文链接:https://www.cnblogs.com/zhaoqianwan/p/17421595.html
千万千万赵千万