随笔分类 -  C++

摘要:#include using namespace std; class CDemo { private: int n; public: CDemo(int i = 0):n(i){} CDemo& operator++(); CDemo operator++(int); operator int() { return n; } friend ... 阅读全文
posted @ 2018-12-23 22:02 Veritas_des_Liberty 阅读(287) 评论(0) 推荐(0)
摘要:#include #include #include using namespace std; class Complex { public: double real, imag; public: Complex(double r = 0, double i = 0): real(r), imag(i){}; friend ostream& operator>(... 阅读全文
posted @ 2018-12-23 21:40 Veritas_des_Liberty 阅读(689) 评论(0) 推荐(0)
摘要:#include #include class CArray { int size; int *ptr; public: CArray(int s = 0); CArray(CArray& a); ~CArray(); void push_back(int v); CArray& operator=(const CArray& a)... 阅读全文
posted @ 2018-12-20 17:51 Veritas_des_Liberty 阅读(598) 评论(0) 推荐(0)
摘要:描述 魔兽世界的西面是红魔军的司令部,东面是蓝魔军的司令部。两个司令部之间是依次排列的若干城市。 红司令部,City 1,City 2,……,City n,蓝司令部两军的司令部都会制造武士。武士一共有 dragon 、ninja、iceman、lion、wolf 五种。每种武士都有编号、生命值、攻击 阅读全文
posted @ 2018-12-19 16:11 Veritas_des_Liberty 阅读(749) 评论(0) 推荐(0)
摘要:3w6:第三周程序填空题1 描述 下面程序输出的结果是: 4,6 请填空: 输入无输出4,6样例输入 样例输出 Code: 3w7:第三周程序填空题2 描述 下面程序输出的结果是: 0 5 请填空: 输入无输出05样例输入 样例输出 提示所缺代码具有如下形式: Code: 3w8:第三周程序填空题3 阅读全文
posted @ 2018-12-18 12:44 Veritas_des_Liberty 阅读(1152) 评论(0) 推荐(0)
摘要:描述 在一个学生信息处理程序中,要求实现一个代表学生的类,并且所有成员变量都应该是私有的。 (注:评测系统无法自动判断变量是否私有。我们会在结束之后统一对作业进行检查,请同学们严格按照题目要求完成,否则可能会影响作业成绩。) 输入姓名,年龄,学号,第一学年平均成绩,第二学年平均成绩,第三学年平均成绩 阅读全文
posted @ 2018-12-13 20:25 Veritas_des_Liberty 阅读(887) 评论(0) 推荐(0)