鉴于周五有c++模拟考试。。又是小崔出的全新的题目。。所以总结一下以前做过的实验和学过的重要的知识点或者思路;
Problem A: 学生比大小//没啥坑。。就是实验的测试用例不完全最开始的答案有bug重新改了之后应该没问题了
#include <iostream>
#include<string>
using namespace std;
class Student
{
public:
string name;
int age;
Student()
{
name="";
age=0;
}
int operator>(Student another)
{
if(age>another.age)
return 1;
else if(age==another.age)
{
int i=0;
while(i!=name.size()||i!=another.name.size())
{
if(name[i]>another.name[i])
return 1;
else if(name[i]==another.name[i])
i++;