摘要: task3: task3.1.cpp 1 #include<iostream> 2 #include<fstream> 3 #include<array> 4 #define N 5 5 int main() 6 { 7 using namespace std; 8 array<int ,5> x{ 阅读全文
posted @ 2022-12-01 17:11 小郑菜菜 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1. pets.hpp. 1 #pragma once 2 #include<iostream> 3 #include<string> 4 5 using namespace std; 6 7 class MachinePets{ 8 public: 9 MachinePets(const stri 阅读全文
posted @ 2022-11-26 16:05 小郑菜菜 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 1.实验内容 1 2 #pragma once 3 #include<iostream> 4 using namespace std; 5 class vectorInt { 6 7 public: 8 vectorInt(int n0); 9 vectorInt(int n0,int value1 阅读全文
posted @ 2022-11-04 19:51 小郑菜菜 阅读(15) 评论(0) 推荐(0) 编辑
摘要: task5: #include<iostream> #include<vector> #include<string> #include"5.1.h" using namespace std; int main() { cout<<"录入信息:"<<endl; cout<<" 昵称"<<" "<<" 阅读全文
posted @ 2022-10-20 18:31 小郑菜菜 阅读(31) 评论(0) 推荐(0) 编辑
摘要: task2:array<int,5> x3<x1>;语句在devc的环境下可能会报错,改成array<int,5> x3(x1)可正确编译。 task3:to_string的功能是将数字常量转换为字符串,还有就是要注意,静态变量类外初始化,并且要注意初始化时没有static。 task4: #pra 阅读全文
posted @ 2022-10-16 09:45 小郑菜菜 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 1. 实验任务1 1.template指的是模板。比如,我们要写一个swap函数来交换两个元素。但这两个元素可能是int也可能使char,如果不用模板的话,我们可能要写多个函数才能完成。但是用模板的话。就可以很轻松的相当与用一个函数完成多项任务、 2.类似v1.begin返回的值是指针类型,因此输出 阅读全文
posted @ 2022-10-03 20:33 小郑菜菜 阅读(8) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/xiaozhengcaicai/ 阅读全文
posted @ 2022-09-29 22:28 小郑菜菜 阅读(32) 评论(0) 推荐(0) 编辑