。。。写一个程序,生成一个命令行方式的可执行文件count.exe,用于统计输出成绩小于给定分数的学生人数。该可执行文件可接受两个参数p1和p2。其中p1为文件名(含路径),包含各个学生的成绩,p2为一个整数,表示需要统计的分数值。例如:
count.exe exam_result.txt 80
统计并输出exam_result.txt中所有成绩低于80分的人数。
Ps:定义Student类
class Student {
string id; // 学号
string name; // 姓名
int mark; // 成绩
public:
Student(const string &strID, const string &strName, int nMark = 0): id(strID), name(strName), mark(nMark) {}
Student(const Student &st) : id(st.id), name(st.name), mark(st.mark) {}
Student& operator = (const Student &st)
{
if (this != &st) { id = st.id; name = st.name; mark = st.mark; }
return *this;
}