摘要: 4: 1 #pragma once 2 3 #include<iostream> 4 #include<string> 5 #include<stdexcept> 6 using namespace std; 7 8 template<typename T> 9 class Vector { 10 阅读全文
posted @ 2024-12-23 21:19 易安135 阅读(20) 评论(0) 推荐(0)
摘要: 3: #pragma once #include<string> #include<iostream> using namespace std; class MachinePets { public: string nickname; public: MachinePets(const string 阅读全文
posted @ 2024-12-04 17:40 易安135 阅读(20) 评论(0) 推荐(0)
摘要: task1: 1 #define _CRT_SECURE_NO_WARNINGS 1 2 3 #include <iostream> 4 5 using std::cout; 6 using std::endl; 7 8 // 类A的定义 9 class A { 10 public: 11 A(in 阅读全文
posted @ 2024-11-24 21:43 易安135 阅读(21) 评论(0) 推荐(0)
摘要: 实验任务1: 代码: 1 #pragma once 2 3 #include<iostream> 4 #include<string> 5 6 using std::string; 7 using std::cout; 8 9 //按钮类 10 class Button { 11 public: 1 阅读全文
posted @ 2024-11-10 23:40 易安135 阅读(18) 评论(0) 推荐(0)
摘要: 实验任务1: 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T &t); // 阅读全文
posted @ 2024-10-30 00:13 易安135 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务1: task1.cpp 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 7 #include 阅读全文
posted @ 2024-10-15 20:46 易安135 阅读(20) 评论(0) 推荐(0)