P5742样例过了,为什么都是WA?
查看原帖
P5742样例过了,为什么都是WA?
877718
xinjiajun666楼主2023/8/3 23:32
#include<bits/stdc++.h>
using namespace std;
struct student{
	int xy,sz,xh;
    int zh(){
    	return (xy*7+sz*10);
	}
}stu[1005];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin >> stu[i].xh >> stu[i].xy >> stu[i].sz;
	}
	for(int i=1;i<=n;i++){
		if(stu[i].xy+stu[i].sz>140&&stu[i].zh()>=800){
			cout<<"Excellent"<<endl;
		}
		else{
			cout<<"Not excellent"<<endl;
		}
	}
	return 0;
}

样例:

4

1223 95 59

1224 50 7

1473 32 45

1556 86 99

输出:

Excellent

Not excellent

Not excellent

Excellent

2023/8/3 23:32
加载中...