摘要: 实验任务1 源代码: #pragma once #include <iostream> #include <stdexcept> // 复数模板类声明 template<typename T> class Complex { public: Complex(T r = 0, T i = 0): re 阅读全文
posted @ 2023-12-13 15:47 LE_SH 阅读(41) 评论(0) 推荐(0)
摘要: 实验任务1 源代码: #pragma once #include <iostream> #include <string> using std::cout; using std::endl; using std::string; // 发行/出版物类:Publisher (抽象类) class Pu 阅读全文
posted @ 2023-12-03 22:38 LE_SH 阅读(13) 评论(0) 推荐(0)
摘要: 实验任务1 源代码: #include <iostream> using std::cout; using std::endl; // 类A的定义 class A{ public: A(int x0, int y0): x{ x0 }, y{ y0 } {} void show() const { 阅读全文
posted @ 2023-11-27 10:49 LE_SH 阅读(44) 评论(0) 推荐(0)
摘要: 实验任务1 point.hpp #pragma once #include <iostream> using std::cout; using std::endl; class Point { public: Point(int x0 = 0, int y0 = 0); ~Point() = def 阅读全文
posted @ 2023-11-05 12:58 LE_SH 阅读(25) 评论(0) 推荐(0)
摘要: 实验任务1 demo1.dev 方法一 #ifndef T_H #define T_H #include <iostream> #include <string> using namespace std; // 类T的声明 class T { public: T(int x = 0, int y = 阅读全文
posted @ 2023-11-05 12:22 LE_SH 阅读(8) 评论(0) 推荐(0)
摘要: 实验任务1 task1.cpp // 标准库string, vector, array基础用法 #include <iostream> #include <string> #include <vector> #include <array> // 函数模板 // 对满足特定条件的序列类型T对象,使用 阅读全文
posted @ 2023-10-16 10:50 LE_SH 阅读(37) 评论(0) 推荐(0)