会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Rainbow-forest
博客园
首页
新随笔
联系
管理
订阅
2023年12月17日
实验6 模板类、文件IO和异常处理
摘要: 四、实验结论 1.实验任务4 Vector.hpp #pragma once #include <iostream> #include <stdexcept> using namespace std; template <typename T> class Vector { private: T*
阅读全文
posted @ 2023-12-17 18:38 夏添添
阅读(53)
评论(0)
推荐(0)
2023年12月3日
实验5 继承和多态
摘要: 四、实验结论 实验任务3 pets.hpp #pragma once #include<iostream> #include<string> using namespace std; class MachinePets { public: MachinePets(const string &s =
阅读全文
posted @ 2023-12-03 17:19 夏添添
阅读(47)
评论(0)
推荐(0)
2023年11月30日
实验4 现代C++标准库与类模板
摘要: 四、实验内容 1.实验任务1 //在C++中定义和使用类模板 task1_1.cpp #include <iostream> using namespace std; // 类A的定义 class A{ public: A(int x0, int y0): x{ x0 }, y{ y0 } {} v
阅读全文
posted @ 2023-11-30 19:20 夏添添
阅读(63)
评论(0)
推荐(0)
2023年11月5日
实验3 类与数组、指针
摘要: 1、实验任务1 源码Point.hpp #pragma once #include <iostream> using std::cout; using std::endl; class Point { public: Point(int x0 = 0, int y0 = 0); ~Point() =
阅读全文
posted @ 2023-11-05 21:28 夏添添
阅读(24)
评论(0)
推荐(1)
2023年10月22日
实验2 类和对象_基础编程2
摘要: 1.实验任务3 程序代码组织如下: •Complex.h 类Complex的声明 #pragma once # include<iostream> # include<cmath> class Complex{ public: Complex(double r = 0, double i = 0);
阅读全文
posted @ 2023-10-22 19:26 夏添添
阅读(22)
评论(0)
推荐(0)
2023年10月19日
实验1 类和对象_基础编程1
摘要: 1.实验任务1 task.1 程序代码: # include<iostream> # include<string> # include<vector> # include <array> template <typename T> void output1(const T &obj){ for(a
阅读全文
posted @ 2023-10-19 18:52 夏添添
阅读(34)
评论(0)
推荐(1)
公告