摘要: 1.Complex类运算符重载 task1_2 #ifndef COMPLEX_HPP #define COMPLEX_HPP #include<iostream> using namespace std; class Complex{ private: double real; double im 阅读全文
posted @ 2021-12-11 19:44 蒋如萍 阅读(25) 评论(2) 推荐(0) 编辑
摘要: 实验四 1.map的用法(实现键值对应): 练习一:输入数字输出字母 #include<iostream> #include<map> #include<string> int main(){ using namespace std; map<int,string> trans{{0,"a"}, { 阅读全文
posted @ 2021-11-27 21:05 蒋如萍 阅读(37) 评论(2) 推荐(0) 编辑
摘要: 任务四: //Vector_int.hpp #include<iostream> #include<initializer_list> using namespace std; class Vector_int{ private: int *p; int n; public: Vector_int( 阅读全文
posted @ 2021-11-09 19:39 蒋如萍 阅读(11) 评论(1) 推荐(0) 编辑
摘要: 任务五:#ifndef INFO_HPP #define INFO_HPP #include<iostream> #include<array> #include<string> #include<iomanip> using namespace std; class Info{ private: 阅读全文
posted @ 2021-10-31 15:33 蒋如萍 阅读(23) 评论(2) 推荐(0) 编辑
摘要: 任务三: #include "Complex.hpp" #include <iostream> int main() { using namespace std; Complex c1(3, -4); const Complex c2(4.5); Complex c3(c1); cout << "c 阅读全文
posted @ 2021-10-24 20:53 蒋如萍 阅读(21) 评论(3) 推荐(0) 编辑