摘要: 实验任务4Vector.hpp源代码 1 #include <iostream> 2 #include <stdexcept> 3 4 template <typename T> 5 class Vector { 6 private: 7 int size; 8 T *vec; 9 public: 阅读全文
posted @ 2023-12-12 16:02 E5rgeXcJV1x5J 阅读(37) 评论(0) 推荐(0)
摘要: 实验任务3pets.hpp源码 1 #include <iostream> 2 using std::string; 3 class MachinePets { 4 private: 5 string nickname; 6 public: 7 MachinePets(const string s) 阅读全文
posted @ 2023-12-01 11:16 E5rgeXcJV1x5J 阅读(28) 评论(0) 推荐(0)
摘要: 实验任务5TextCoder.hpp源码 1 #include<iostream> 2 #include<string> 3 4 using std::string; 5 6 class TextCoder { 7 private: 8 string text; 9 void encoder(); 阅读全文
posted @ 2023-11-27 10:08 E5rgeXcJV1x5J 阅读(58) 评论(0) 推荐(0)
摘要: 实验任务1Point.hpp源码 1 #pragma once 2 3 #include <iostream> 4 using std::cout; 5 using std::endl; 6 7 class Point { 8 public: 9 Point(int x0 = 0, int y0 = 阅读全文
posted @ 2023-11-02 20:44 E5rgeXcJV1x5J 阅读(51) 评论(0) 推荐(0)
摘要: 实验任务3代码结构 task3 ├─ Complex.hpp └─ main.cpp程序源码 Complex.hpp 1 #include <iostream> 2 #include<cmath> 3 4 class Complex { 5 private: 6 double real, imag; 阅读全文
posted @ 2023-10-17 22:58 E5rgeXcJV1x5J 阅读(74) 评论(0) 推荐(0)
摘要: 实验任务1 task1.cpp源码 1 // 标准库string, vector, array基础用法 2 #include <iostream> 3 #include <string> 4 #include <vector> 5 #include <array> 6 7 // 函数模板 8 // 阅读全文
posted @ 2023-10-13 13:30 E5rgeXcJV1x5J 阅读(63) 评论(0) 推荐(0)