摘要: 实验任务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-17 16:45 张文瑞 阅读(30) 评论(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-04 09:39 张文瑞 阅读(14) 评论(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-12-01 00:19 张文瑞 阅读(31) 评论(0) 推荐(0)
摘要: 任务1 源代码: 1 1 #pragma once 2 2 3 3 #include <iostream> 4 4 using std::cout; 5 5 using std::endl; 6 6 7 7 class Point { 8 8 public: 9 9 Point(int x0 = 0 阅读全文
posted @ 2023-11-07 22:08 张文瑞 阅读(20) 评论(0) 推荐(0)
摘要: 1、实验一 程序源码: #include <iostream> #include<cmath> class Complex { private: double real, imag; public: Complex(double r = 0, double i = 0) : real{r}, ima 阅读全文
posted @ 2023-10-23 08:38 张文瑞 阅读(19) 评论(0) 推荐(0)
摘要: 1.实验任务1: 实验源代码: 1 // 标准库string, vector, array基础用法 2 #include <iostream> 3 #include <string> 4 #include <vector> 5 #include <array> 6 // 函数模板 7 // 对满足特 阅读全文
posted @ 2023-10-19 22:31 张文瑞 阅读(31) 评论(0) 推荐(0)