写三个循环找即可
2024-08-17 11:17:41
发布于:云南
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int day[15];
int main(){
for(int i = 1;i <= 7;i++){
int a,b; cin >> a >> b;
day[i] = a + b;
}
bool right = 1;
for(int i = 1;i <= 7;i++){
if(day[i] > 8) right = 0;
}
if(right) cout << 0;
else{
int ans = 0,now = -1;
for(int i = 1;i <= 7;i++){
if(now < day[i]){
now = day[i];
ans = i;
}
}
cout << ans;
}
return 0;
}
这里空空如也
有帮助,赞一个