摘要: 1.实验任务4 1 #include <iostream> 2 #include <stdexcept> 3 4 template <typename T> 5 class Vector { 6 private: 7 T* data; 8 size_t size; 9 public: 10 Vect 阅读全文
posted @ 2023-12-17 21:40 崎膺 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 实验任务3 1 #pragma once 2 #include <string> 3 #include <iostream> 4 5 class MachinePets { 6 public: 7 MachinePets(const std::string& s); 8 virtual ~Machi 阅读全文
posted @ 2023-12-03 22:27 崎膺 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 实验任务5 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 class TextCoder { 6 private: 7 string text; 8 void encoder(); 9 void decode 阅读全文
posted @ 2023-11-30 23:13 崎膺 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1.实验任务1 point.hpp 1 #include <iostream> 2 #include "point.hpp" 3 #include <vector> 4 using std::vector; 5 using std::cin; 6 // 输出vector<Point>对象内所有点的坐 阅读全文
posted @ 2023-11-05 21:43 崎膺 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 3.实验任务3 1 #pragma once 2 3 #include <iostream> 4 #include <cmath> 5 6 class Complex { 7 public: 8 Complex(double r = 0, double i = 0) : real(r), imag( 阅读全文
posted @ 2023-10-22 19:13 崎膺 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 实验任务1 源代码: 1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<array> 5 6 7 template<typename T> 8 void output1(const T &obj){ 9 for 阅读全文
posted @ 2023-10-19 21:55 崎膺 阅读(11) 评论(0) 推荐(0) 编辑