目前位置: VCer资源中心 >>> VCer代码 >>> C++/MFC基础

[本帖已阅读739次 分值80 回复0次] 张贴资源 发回信箱 控制面板

求助大牛……

提供者:deepsolo 张贴时间:2007-09-03 18:51:12.0 出处:vcer.net 作者:yaha

求助大牛……(2007-09-03 18:51:12.0)


yaha


 
级别: VCer小兵
头衔: VCer会员

经验: 81
作品: 1
分会: 华北分会
注册: 2007-09-03 18:29:11.0
登录: 2007-09-03 18:29:30.0

。。。写一个程序,生成一个命令行方式的可执行文件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;

  }

注:转载文章需注明来源:VCer.net 文章地址:http://vcer.net/1188816672156.html

  如果你觉得VCer.net不错,而且你愿意为VCer.net捐赠一元钱,那么点击后面的捐赠按钮吧:) vcer.net捐赠

[回复该贴] [加入个人书签]
[投票结果]

A: 评分 10 0% (0 票)
B: 评分 5 0% (0 票)
C: 评分 0 0% (0 票)
D: 评分 -5 0% (0 票)
E: 评分 -10 0% (0 票)