会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
the-existent
博客园
首页
新随笔
联系
订阅
管理
2024年12月16日
实验6 模板类、文件I/O和异常处理
摘要: task4: Vector.hpp源代码: 1 #include<iostream> 2 3 using namespace std; 4 5 template <typename T> 6 class Vector 7 { 8 public: 9 Vector(int nn) :n{ nn } {
阅读全文
posted @ 2024-12-16 20:46 存在者
阅读(15)
评论(0)
推荐(0)
2024年12月3日
实验5 继承和多态
摘要: task 3: #include <iostream> #include <vector> using namespace std; class MachinePets { public: MachinePets(const string s):nickname{s}{} virtual strin
阅读全文
posted @ 2024-12-03 16:41 存在者
阅读(9)
评论(0)
推荐(0)
2024年11月23日
实验4 类的组合、继承、模板类、标准库
摘要: task2: GradeCalc.hpp: #include <iostream> #include <vector> #include <string> #include <algorithm> #include <numeric> #include <iomanip> using std::ve
阅读全文
posted @ 2024-11-23 19:24 存在者
阅读(25)
评论(0)
推荐(0)
2024年11月6日
实验3 类和对象_基础编程2
摘要: test1: task1.cpp: #include "window.hpp" #include <iostream> using std::cout; using std::cin; void test() { Window w1("new window"); w1.add_button("max
阅读全文
posted @ 2024-11-06 22:38 存在者
阅读(33)
评论(0)
推荐(0)
2024年10月23日
实验2 类和对象_基础编程1
摘要: task 1: t.h: #pragma once #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(int x = 0, int y = 0); // 普通构造函数 T(const T &t); // 复制构造函数 T(T &&t
阅读全文
posted @ 2024-10-23 18:48 存在者
阅读(20)
评论(0)
推荐(0)
2024年10月12日
实验一 现代C++编程初体验
摘要: case 1: // 现代C++标准库、算法库体验 // 本例用到以下内容: // 1. 字符串string, 动态数组容器类vector、迭代器 // 2. 算法库:反转元素次序、旋转元素 // 3. 函数模板、const引用作为形参 #include <iostream> #include <s
阅读全文
posted @ 2024-10-12 18:23 存在者
阅读(14)
评论(0)
推荐(0)
公告