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

📄 5-2-1.cpp

📁 学习c++的ppt
💻 CPP
字号:
#include <iostream.h>
#include <string.h>
class  Student {
     private:
            int       iNo;
            char    sName[10];
            float    fEng,fMath, fCmp;
      public :                    
            Student(int no, char  *sn,  float  e,  float m, float c)
            {    
                  iNo = no; 
                  strcpy(sName, sn);
                  fEng = e; fMath = m; fCmp = c;
                  cout<< "姓名:" << sName << " -学生的构造函数被调用"<<endl;
            }
            float  GetAvg(); 
            float  GetTotal();
} ;
void main()
{   Student  std1(1001, "zhang", 77, 89, 82);
    Student  std2(1002, "wang", 87, 92, 78);
}

⌨️ 快捷键说明

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