?? student_info.cpp
字號:
#include"Student_info.h"
using namespace std;
bool compare(const Student_info& x,const Student_info& y)
{
return x.name<y.name;
}
istream& read(istream& is,Student_info& s)
{
//read an store th student's name and midterm and final exam grades
is>>s.name>>s.midterm>>s.final;
read_hw(is,s.homework); //read and store all the students homework grades
return is;
}
//read homework grades from an input stream into a 'vector'
istream& read_hw(istream& in,vector<double>& hw)
{
if(in)
{
//get rid of previous contents
hw.clear();
//read homework grades
double x;
while(in>>x)
hw.push_back(x);
//clear the stream so that input will work for the next student
in.clear();
}
return in;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -