题解
2026-02-14 09:01:31
发布于:湖北
10阅读
0回复
0点赞
直接循环输入再进行判断即可。
代码如下:
#include<bits/stdc++.h>
using namespace std;
int n,x,y,ans,t;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>x;
cin>>y;
if((x>=90&&x<=140)&&(y>=60&&y<=90)){
t++;
}else{
ans=max(ans,t);
t=0;
}
}
ans=max(ans,t);
cout<<ans;
return 0;
}
全部评论 1
代码提交于2026-02-14上午9:00
2026-02-14 来自 湖北
0




有帮助,赞一个