提示[Hydro](https://hydro.ac)提供评测服务

为什么编译器能过,这里提示Hydro提供评测服务
#include<iostream>
#include<string>
#define MAX 1000
using namespace std;

//学生信息结构体
struct Student
{
string s_name;
int s_scoreNum;
int s_classNum;
string s_leader;
string s_west;
int s_paper;
int s_money;

};
//学生数组结构体
struct classnumber
{
struct Student arr[MAX];
int size;
};

//写入学生信息
void addStudent(classnumber* c)
{
cin >> c->size;

for (int i = 0; i < c->size; i++)
{
cin >> c->arr[i].s_name >>
c->arr[i].s_scoreNum >>
c->arr[i].s_classNum >>
c->arr[i].s_leader >>
c->arr[i].s_west >>
c->arr[i].s_paper;
c->arr[i].s_money = 0;
}
}

//计算奖学金数量
void sum(classnumber* c)
{

for (int i = 0; i < c->size; i++)
{
//院士奖学金
if (c->arr[i].s_scoreNum > 80 && c->arr[i].s_paper >= 1)
{
c->arr[i].s_money += 8000;
}
//五四奖学金
if (c->arr[i].s_scoreNum > 85 && c->arr[i].s_classNum > 80)
{
c->arr[i].s_money += 4000;
}
//成绩优秀奖
if (c->arr[i].s_scoreNum > 90)
{
c->arr[i].s_money += 2000;
}
//西部奖学金
if (c->arr[i].s_scoreNum > 85 && c->arr[i].s_west == "Y")
{
c->arr[i].s_money += 1000;
}
//班级贡献奖
if (c->arr[i].s_classNum > 80 && c->arr[i].s_leader == "Y")
{
c->arr[i].s_money += 850;
}
}
}

int main()
{
int temp = 0;
string name;
int all = 0;
classnumber c;

addStudent(&c);
sum(&c);

for (int i = c.size - 1; i > 0; i--)
{
if (c.arr[i].s_money > temp)
{
name = c.arr[i].s_name;
temp = c.arr[i].s_money;
}
}

cout << name << endl;
cout << temp << endl;

for (int i = 0; i < c.size; i++)
{
all = all + c.arr[i].s_money;
}
cout << all << endl;

system("pause");
return 0;
}

1 条评论

  • @ 2021-09-23 20:51:44

    确实是 Hydro 提供的评测服务,不是你的代码出了问题。

  • 1

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
37247
已通过
12252
通过率
33%
被复制
72
上传者