拉了,全WA
  • 板块灌水区
  • 楼主柳清念_
  • 当前回复1
  • 已保存回复1
  • 发布时间2021/7/27 21:12
  • 上次更新2023/11/4 13:06:27
查看原帖
拉了,全WA
258953
柳清念_楼主2021/7/27 21:12

哪里错了,www 题目在这里

蒟蒻代码↓

#include<bits/stdc++.h>
using namespace std;
int n,js,maxn = -1;

struct students{
	string name;
	char work,west;
	int final_score,score,money,num;
}student[101];

int qian(int n){
	if(student[n].work == 'Y' and student[n].score > 80){
		student[n].money += 850;
	}
	if(student[n].final_score > 80 and student[n].num >= 1){
		student[n].money += 8000;
	}
	if(student[n].final_score >= 85 and student[n].score > 80){
		student[n].money += 4000;
	}
	if(student[n].final_score > 90){
		student[n].money += 2000;
	}
	if(student[n].west == 'Y' and student[n].final_score > 85){
		student[n].money += 1000;
	}
	return student[n].money ;
}

int main(){
	int l;
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>student[i].name >>student[i].final_score >>student[i].score>>student[i].work>>student[i].west>>student[i].num;
	}
	for(int i=0;i<n;++i){
		js += qian(i);
		if(student[i].money > maxn){
			l = i;
			maxn = student[i].money;
		}else if(student[i].money <= maxn){
			l = l;
			maxn = maxn;
		}
	}
	cout<<student[l].name<<endl<<student[l].money<<endl<<js;
	return 0;
}
2021/7/27 21:12
加载中...