80分,谁帮我看看,测试过没啥问题啊
查看原帖
80分,谁帮我看看,测试过没啥问题啊
1379218
ade_4389楼主2025/1/7 20:03

#include using namespace std; int n,xuehao[1000005],xueye[105],suzhi[105],cnt[1005];float zonghe[1005];

bool check(int x){ if(cnt[x]>140) return true; return false; } bool check_2(int y){ if(zonghe[y]>80) return true; return false; }

int main() { cin>>n; for(int i=1;i<=n;i++){ cin>>xuehao[i]>>xueye[i]>>suzhi[i]; cnt[i]=xueye[i]+suzhi[i]; zonghe[i]=xueye[i]*0.7+suzhi[i]*0.3; } for(int i=1;i<=n;i++){ if(check(i)&&check_2(i)){ cout<<"Excellent"<<endl; } else cout<<"Not excellent"<<endl; } }

#include<iostream>
using namespace std;
int n,xuehao[1000005],xueye[105],suzhi[105],cnt[1005];float zonghe[1005];

bool check(int x){
	if(cnt[x]>140) return true;
	return false;
}
bool check_2(int y){
	if(zonghe[y]>80) return true;
	return false;
}

int main()
{
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>xuehao[i]>>xueye[i]>>suzhi[i];
		cnt[i]=xueye[i]+suzhi[i];
		zonghe[i]=xueye[i]*0.7+suzhi[i]*0.3;
	}
	for(int i=1;i<=n;i++){
		if(check(i)&&check_2(i)){
			cout<<"Excellent"<<endl;
		}
		else
		cout<<"Not excellent"<<endl;
	}
}
2025/1/7 20:03
加载中...