摘要: task4: Vector.hpp #pragma once #include<iostream> #include<stdexcept> using namespace std; template <typename T> class Vector { public: Vector(int siz 阅读全文
posted @ 2024-12-17 18:09 bearrrr 阅读(8) 评论(0) 推荐(0) 编辑
摘要: task3: pets.hpp #pragma once #include<iostream> using namespace std; class MachinePets { public: MachinePets(const string& s) :nickname{ s } {} virtua 阅读全文
posted @ 2024-12-02 22:01 bearrrr 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 任务1: 1 #include <iostream> 2 3 using std::cout; 4 using std::endl; 5 6 // 类A的定义 7 class A { 8 public: 9 A(int x0, int y0); 10 void display() const; 11 阅读全文
posted @ 2024-11-21 15:10 bearrrr 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 任务1: button.hpp #pragma once #include <iostream> #include <string> using std::string; using std::cout; // 按钮类 class Button { public: Button(const stri 阅读全文
posted @ 2024-11-04 23:03 bearrrr 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 任务1: t.h #pragma once #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(int x = 0, int y = 0); // 普通构造函数 T(const T &t); // 复制构造函数 T(T &&t); / 阅读全文
posted @ 2024-10-26 13:47 bearrrr 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 任务1: // 现代C++标准库、算法库体验 // 本例用到以下内容: // 1. 字符串string, 动态数组容器类vector、迭代器 // 2. 算法库:反转元素次序、旋转元素 // 3. 函数模板、const引用作为形参 #include <iostream> #include <stri 阅读全文
posted @ 2024-10-10 18:10 bearrrr 阅读(15) 评论(0) 推荐(0) 编辑