-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunc.cpp.txt
44 lines (41 loc) · 1.02 KB
/
func.cpp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "func.h"
int CompareName(Student s1, Student s2)
{
if(MyStrcmp(s1.GetName(), s2.GetName()) == 0)
return 0;
if(MyStrcmp(s1.GetName(), s2.GetName()) > 0)
return 1;
return -1;
}
int CompareAvarage(Student s1, Student s2)
{
if(s1.GetAvarage() == s2.GetAvarage())
return 0;
if(s1.GetAvarage() > s2.GetAvarage())
return 1;
return -1;
}
int CompareMathGrade(Student s1, Student s2)
{
if(s1.GetMathGrade() == s2.GetMathGrade())
return 0;
if(s1.GetMathGrade() > s2.GetMathGrade())
return 1;
return -1;
}
int CompareEnglishGrade(Student s1, Student s2)
{
if(s1.GetEnglishGrade() == s2.GetEnglishGrade())
return 0;
if(s1.GetEnglishGrade() > s2.GetEnglishGrade())
return 1;
return -1;
}
int CompareHistoryGrade(Student s1, Student s2)
{
if(s1.GetHistoryGrade() == s2.GetHistoryGrade())
return 0;
if(s1.GetHistoryGrade() > s2.GetHistoryGrade())
return 1;
return -1;
}