- 博客(11)
- 收藏
- 关注
原创 第十二周项目:教师兼干部类
代码: #include <iostream> #include <string> using namespace std; class Teacher { public: Teacher(string nam,int a,char s,string ad,string te,string ti):name(nam),age(a),sex(s),addr(...
2015-05-27 08:47:32 286
原创 第十二周课后实践:阅读程序
(1) 代码: #include <iostream> using namespace std; class A { public: A() { a=0; } A (int i) { a=i; } void print() { cout<<a<&...
2015-05-26 13:36:59 457
原创 第十一周项目:程序填空--是春哥啊
代码: #include <iostream> #include <cstring> using namespace std; class Person { public: Person(char* s) { strcpy(name,s); } void display() { cout<...
2015-05-24 14:02:05 288
原创 第十一周项目:职员有薪水了(2)
代码: #include <iostream> #include <cstring> #include <iomanip> using namespace std; class CPerson { protected: char *m_szName; char *m_szId; int m_nSex;//0:women,1:m...
2015-05-24 13:55:52 270
原创 第十一周项目:职员有薪水了(1)
代码: #include <iostream> #include <string> #include <iomanip> using namespace std; class CPerson { protected: string m_szName; string m_szId; int m_nSex;//0:woman,1:...
2015-05-20 09:26:43 284
原创 第十一周项目:存储班长信息的学生类(2)
代码: #include <iostream> #include <string> using namespace std; class Stu //声明基类 { public: Stu(int n, string nam):num(n),name(nam){}; //基类构造函数 void display(); //成员函...
2015-05-20 09:00:22 331
原创 第十一周项目:存储班长信息的学生类(1)
代码: #include <iostream> #include <string> using namespace std; class Stu //声明基类 { public: Stu(int n, string nam):num(n),name(nam){}; //基类构造函数 void display(); //成员函...
2015-05-20 08:34:13 305
原创 第十一周课后实践:阅读程序
(一) 代码: #include <iostream> using namespace std; class Data { public: Data(int i):x(i) { cout<<"A"; } ~Data() { cout<<"B"; } private: i...
2015-05-19 20:10:20 276
原创 第十周项目:复数类中的运算符重载(续)(2)
代码: #include <iostream> using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} Complex operator+(const Complex &c2...
2015-05-13 08:30:08 272
原创 第十周项目:复数类中的运算符重载(续)(1)
代码: #include <iostream> using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} friend Complex operator+(Complex &c1...
2015-05-12 20:45:42 286
原创 第十周课后实践:阅读程序--学生信息管理系统
代码: #include <iostream> #include <cstring> using namespace std; #define MAX 100 class CDate // 定义日期类 { private: unsigned short int year; // 年 unsigned short int month; //...
2015-05-12 20:33:21 496
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人