摘要: 实验四: Vector.hpp: // #pragma once #include <iostream> #include <stdexcept> using namespace std; template <typename T> class Vector { private: T* data; 阅读全文
posted @ 2023-12-17 22:28 铃鹿浅芊 阅读(15) 评论(0) 推荐(0)
摘要: 实验任务1 publisher.hpp #pragma once #include<iostream> #include<string> using std::cout; using std::string; using std::endl; class publisher{ public: pub 阅读全文
posted @ 2023-12-03 23:42 铃鹿浅芊 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务1 task1.cpp源码 task1_1.cpp: #include <iostream> using std::cout; using std::endl; //类A的定义 class A { public: A(int x0, int y0) : x{ x0 }, y{ y0 } {} 阅读全文
posted @ 2023-11-30 23:53 铃鹿浅芊 阅读(25) 评论(0) 推荐(0)
摘要: 一.实验任务一 point.hpp #pragma once #include <iostream> using std::cout; using std::endl; class Point { public: Point(int x0 = 0, int y0 = 0); ~Point() = d 阅读全文
posted @ 2023-11-06 00:16 铃鹿浅芊 阅读(41) 评论(0) 推荐(0)
摘要: 实验一: 类的定义文件 t.h #pragma once #include <iostream> #include <string> using namespace std; // 类T的声明 class T { public: T(int x = 0, int y = 0); // 带有默认形值的 阅读全文
posted @ 2023-10-23 00:36 铃鹿浅芊 阅读(28) 评论(0) 推荐(0)
摘要: 实验一 实验代码: // 标准库string, vector, array基础用法 #include <iostream> #include <string> #include <vector> #include <array> // 函数模板 // 对满足特定条件的序列类型T对象,使用范围for输 阅读全文
posted @ 2023-10-20 00:25 铃鹿浅芊 阅读(23) 评论(0) 推荐(0)