摘要: task4.hpp #include<iostream> #include<stdexcept> #include <cassert> using namespace std; template<typename T> class Vector { private: T* ptr; int size 阅读全文
posted @ 2023-12-17 19:55 贾睿 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1. .hpp #pragma once #include <iostream> using std::cout; using std::endl; class Point { public: Point(int x0 = 0, int y0 = 0); ~Point() = default; in 阅读全文
posted @ 2023-11-05 16:39 贾睿 阅读(14) 评论(0) 推荐(0) 编辑
摘要: task.3 .hpp #pragma once #include<iostream> #include<cmath> class Complex{ public : Complex(double r=0,double i=0){ real=r;imag=i ;} Complex(const Com 阅读全文
posted @ 2023-10-22 20:07 贾睿 阅读(12) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> #include<vector> #include<array> // 函数模板 // 对满足特定条件的序列类型T对象,使用范围for输出 template<typename T> void output1(const T &o 阅读全文
posted @ 2023-10-17 12:36 贾睿 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include "Vector.hpp" void test() { using namespace std; int n; cin >> n; Vector<double> x1(n); for(auto i = 0; i < n; ++i) x1.at( 阅读全文
posted @ 2022-12-07 14:45 贾睿 阅读(48) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<iostream> #include<string> using namespace std; class MachinePets{ private: string nickname; public: MachinePets(const string &s 阅读全文
posted @ 2022-11-30 11:02 贾睿 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<iostream> using namespace std; class vectorInt { public: vectorInt(int n); vectorInt(int n, int value); vectorInt(const vectorIn 阅读全文
posted @ 2022-11-09 11:06 贾睿 阅读(5) 评论(0) 推荐(0) 编辑
摘要: info.hpp#pragma once #include<iostream> #include<string> using namespace std; class Info { public: Info(string nn, string cont, string ct,int x); void 阅读全文
posted @ 2022-10-26 09:52 贾睿 阅读(6) 评论(0) 推荐(0) 编辑
摘要: task.4 #include<iostream> #include<math.h> using namespace std; class Complex { private: float real, imag; public: Complex(float r, float i);//带两个参数的构 阅读全文
posted @ 2022-10-19 12:15 贾睿 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 实验 2 #include<iostream> using namespace std; class point {public: point(int x0= 0,int y0=0); point(const point&p); ~point()=default; int get_x() const 阅读全文
posted @ 2022-10-04 17:34 贾睿 阅读(4) 评论(0) 推荐(0) 编辑