⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 student.cpp

📁 简易学生管理系统,有删除添加查找编辑修改等功能
💻 CPP
字号:
#include <iostream>
#include "Student.h"
using namespace std;


Student::Student(unsigned int i, char* n, char g, unsigned int a, double s)
{
	id = i;
	strcpy(name, n);
	gender = g;
	age = a;
	score = s;
}

bool Student::operator < (const Student &rhs)
{
	return this->score < rhs.score;
}

ostream& operator << (ostream& os, const Student& rhs)
{
	os << rhs.id << "\t" << rhs.name << "\t" 
		<< rhs.gender << "\t" << rhs.age << "\t" 
		<< rhs.score << endl;
	return os;
}

istream& operator >> (istream& is, Student& rhs)
{
	cout << "Please enter id: ";
	is >> rhs.id;
	cout << "Please enter name: ";
	is >> rhs.name;
	cout << "Please enter gender: ";
	is >> rhs.gender;
	cout << "Please enter age: ";
	is >> rhs.age;
	cout << "Please enter score: ";
	is >> rhs.score;

	return is;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -