2.源代码(所有代码均在.cpp 文件中,所以有点乱; 另:在 vs2013 下编译通过,
在 vc6.0 下需要将 strcpy_s 改为 strcpy,某处的循环变量 i 会出现错误,改为 j 即
可;文件需事先创建)
#include<iostream>
#include<string.h>
#include<fstream>
#include<iomanip>
using namespace std;
//------------------------------------------------------------//
//------------------------类----------------------------------//
//------------------------------------------------------------//
//
//------------------------成绩类------------------------------//
class CGrade
{
public:
private:
float fCpp, fMath, fEnglish;
CGrade(){}
CGrade(float fCpp, float fMath, float fEnglish);
~CGrade();
void setCpp(float fCpp);
void setMath(float fMath);
void setEnglish(float fEnglish);
float getCpp();
float getMath();
float getEnglish();