我想问个问题,为什么我没过还100分
查看原帖
我想问个问题,为什么我没过还100分
682799
Chronostasis_WHY楼主2022/8/25 14:38

代码如下:

#include <iostream>
using namespace std;

int main(){
	int unhappy = 0,max_time = 0,school_time = 0,other_time = 0;
	for(int i = 0;i < 7;i++){
		cin>>school_time>>other_time;
		if(school_time + other_time >= 8 && school_time + other_time > max_time){
			unhappy = i + 1;
			max_time = school_time + other_time; 
		}
	}
	
	cout<<unhappy;
	return 0;
}
2022/8/25 14:38
加载中...