# 成绩统计

**问题描述**

编写一个程序，建立了一条单向链表，每个结点包含姓名、学号、英语成绩、数学成绩和C++成绩，并通过链表操作平均最高的学生和平均分最低的学生并且输出。  

**输入格式**

输入n+1行，第一行输入一个正整数n，表示学生数量；接下来的n行每行输入5个数据，分别表示姓名、学号、英语成绩、数学成绩和C++成绩。注意成绩有可能会有小数。  

**输出格式**

输出两行，第一行输出平均成绩最高的学生姓名。第二行输出平均成绩最低的学生姓名。  

**样例输入**

```
2
yx1 1 45 67 87
yx2 2 88 90 99
```

**样例输出**

```
yx2
yx1
```

## aop
### before
```cpp
#include <iostream>
using namespace std;
```
### after
```cpp

```

## 答案
```cpp
int main()
{
	struct student
	{
		string xm;
		int xh;
		double yy;
		double sx;
		double cpp;
	};
	student a[1000];
	int n;
	double sum = 0, min = 301, max = 0;
	string mins, maxs;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i].xm >> a[i].xh >> a[i].yy >> a[i].sx >> a[i].cpp;
		sum = a[i].yy + a[i].sx + a[i].cpp;
		if (min > sum)
		{
			min = sum;
			mins = a[i].xm;
		}
		if (max < sum)
		{
			max = sum;
			maxs = a[i].xm;
		}
	}
	cout << maxs << endl
		 << mins;
	return 0;
}

```
## 选项

### A
```cpp
int main()
{
	struct student
	{
		string xm;
		int xh;
		double yy;
		double sx;
		double cpp;
	};
	student a[1000];
	int n;
	double sum = 0, min = 301, max = 0;
	string mins, maxs;
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		cin >> a[i].xm >> a[i].xh >> a[i].yy >> a[i].sx >> a[i].cpp;
		sum = a[i].yy + a[i].sx + a[i].cpp;
		if (min > sum)
		{
			min = sum;
			mins = a[i].xm;
		}
		if (max < sum)
		{
			max = sum;
			maxs = a[i].xm;
		}
	}
	cout << maxs << endl
		 << mins;
	return 0;
}
```

### B
```cpp
int main()
{
	struct student
	{
		string xm;
		int xh;
		double yy;
		double sx;
		double cpp;
	};
	student a[1000];
	int n;
	double sum = 0, min = 301, max = 0;
	string mins, maxs;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i].xm >> a[i].xh >> a[i].yy >> a[i].sx >> a[i].cpp;
		sum = a[i].yy + a[i].sx + a[i].cpp;
		if (min > sum)
		{
			min = sum;
			mins = a[i]->xm;
		}
		if (max < sum)
		{
			max = sum;
			maxs = a[i]->xm;
		}
		cout << maxs << endl
			 << mins;
		return 0;
	}
}
```

### C
```cpp
int main()
{
	struct student
	{
		string xm;
		int xh;
		double yy;
		double sx;
		double cpp;
	};
	student a[1000];
	int n;
	double sum = 0, min = 301, max = 0;
	string mins, maxs;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i].xm >> a[i].xh >> a[i].yy >> a[i].sx >> a[i].cpp;
		sum = a[i].yy + a[i].sx + a[i].cpp;
		if (min > sum)
		{
			min = sum;
			mins = a[i].xm;
		}
		if (max < sum)
		{
			max = sum;
			maxs = a[i].xm;
		}
	}
	cout << mins << endl
		 << maxs;
	return 0;
}
```
