求助!为什么爆0了!
查看原帖
求助!为什么爆0了!
717437
paulpao楼主2022/8/8 11:34
#include<iostream>
using namespace std;
struct a{
	int number,study,suzhi;
	double zonghe;
};
int main(){
	int n;
	a b[100000001];
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>b[i].number>>b[i].study>>b[i].suzhi;
		b[i].zonghe=b[i].study*0.7+b[i].suzhi*0.3;
	}
	for(int i=1;i<=n-1;i++){
		if(b[i].zonghe>=80&&b[i].study+b[i].suzhi>80){
			cout<<"Excellent\n";
		}
		else{
			cout<<"Not excellent\n";
		}
	}
	if(b[n].zonghe>=80&&b[n].study+b[n].suzhi>80){
			cout<<"Excellent";
		}
	else{
			cout<<"Not excellent";
	}
	return 0;
} 
2022/8/8 11:34
加载中...