会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
8716ydc
博客园
首页
新随笔
联系
订阅
管理
2023年12月17日
实验6 模板类、文件IO和异常处理
摘要: 任务4 1 #include <iostream> 2 #include "Vector.hpp" 3 4 void test() { 5 using namespace std; 6 7 int n; 8 cin >> n; 9 10 Vector<double> x1(n); 11 for (a
阅读全文
posted @ 2023-12-17 22:54 袁德聪
阅读(14)
评论(0)
推荐(0)
2023年12月3日
实验5 继承和多态
摘要: 任务3 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 5 class MachinePets { 6 public: 7 MachinePets(const string& s); 8 MachinePets();
阅读全文
posted @ 2023-12-03 20:48 袁德聪
阅读(27)
评论(0)
推荐(0)
2023年11月30日
实验4 现代C++标准库与类模板
摘要: 任务5 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 class TextCoder { 6 public: 7 TextCoder() = default; 8 TextCoder(string str);
阅读全文
posted @ 2023-11-30 20:30 袁德聪
阅读(28)
评论(0)
推荐(0)
2023年11月5日
实验三 类与数组、指针
摘要: 任务1 1 #pragma once 2 #include <iostream> 3 using std::cout; 4 using std::endl; 5 class Point { 6 public: 7 Point(int x0 = 0, int y0 = 0); 8 ~Point() =
阅读全文
posted @ 2023-11-05 20:49 袁德聪
阅读(31)
评论(0)
推荐(0)
2023年10月22日
实验二 类和对象
摘要: 实验任务三 1 #include <iostream> 2 #include <cmath> 3 4 class Complex { 5 6 private: 7 double real; 8 double imag; 9 10 public: 11 Complex(double r = 0, do
阅读全文
posted @ 2023-10-22 23:10 袁德聪
阅读(20)
评论(0)
推荐(0)
2023年10月20日
实验1 类和对象
摘要: // 标准库string, vector, array基础用法 #include <iostream> #include <string> #include <vector> #include <array> // 函数模板 // 对满足特定条件的序列类型T对象,使用范围for输出 template
阅读全文
posted @ 2023-10-20 00:16 袁德聪
阅读(40)
评论(0)
推荐(0)
公告