PAT 1028 List Sorting 翻译 分析 代码

#include
#include
#include
using namespace std;
struct student{
	int id;
	char name[10];
	int sorce;
}stu[100010];

bool cmp1(student a,student b)
{
	return a.id

Sample Input 1

3 1
000007 James 85
000010 Amy 90
000001 Zoe 60

Sample Output 1

000001 Zoe 60
000007 James 85
000010 Amy 90

Sample Input 2

4 2
000007 James 85
000010 Amy 90
000001 Zoe 60
000002 James 98

Sample Output 2

000010 Amy 90
000002 James 98
000007 James 85
000001 Zoe 60

Sample Input 3

4 3
000007 James 85
000010 Amy 90
000001 Zoe 60
000002 James 90

Sample Output 3

000001 Zoe 60
000007 James 85
000002 James 90
000010 Amy 90

你可能感兴趣的:(PAT,初识代码,小白进阶)