会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zyf-666
博客园
首页
新随笔
联系
订阅
管理
2024年12月17日
实验6
摘要: 实验任务4: 1 #include<iostream> 2 #include<stdexcept> 3 4 using namespace std; 5 6 template<typename T> 7 class Vector{ 8 public: 9 Vector(int n); 10 Vect
阅读全文
posted @ 2024-12-17 17:02 白小泽
阅读(3)
评论(0)
推荐(0)
2024年12月4日
实验5
摘要: 实验任务3: 1 #pragma once 2 #include<iostream> 3 using namespace std; 4 class MachinePets{ 5 string nickname; 6 public: 7 MachinePets(const string &s){ 8
阅读全文
posted @ 2024-12-04 20:28 白小泽
阅读(13)
评论(0)
推荐(0)
2024年11月18日
实验4
摘要: 实验任务1: 1 #include <iostream> 2 3 using std::cout; 4 using std::endl; 5 6 // 类A的定义 7 class A { 8 public: 9 A(int x0, int y0); 10 void display() const;
阅读全文
posted @ 2024-11-18 18:28 白小泽
阅读(15)
评论(0)
推荐(0)
2024年11月5日
实验3
摘要: 实验任务1: 问题1:一共2个类,使用了标准库的string和vector 问题2:剩余成员函数基本不改变对象的值,没有必要加const,可以设置inline 问题3:初始化一个string类型的对象用于分割输出结果 实验任务2: 问题1:第一行定义并初始化一个vector类型存储int类型数据的对
阅读全文
posted @ 2024-11-05 15:48 白小泽
阅读(24)
评论(0)
推荐(0)
2024年10月23日
实验2
摘要: 实验任务1: 源码及截图: 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T
阅读全文
posted @ 2024-10-23 17:11 白小泽
阅读(16)
评论(0)
推荐(0)
2024年10月9日
实验一 C++
摘要: 实验任务1: task1.cpp: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <algorithm> 5 6 using namespace std; 7 8 // 声明 9 // 模板函数声明
阅读全文
posted @ 2024-10-09 16:56 白小泽
阅读(25)
评论(0)
推荐(0)
公告