当在子类中对基类的方法进行覆盖时,使用Pet *cat = new Cat("加菲") 进行变量声明时,调用覆盖的函数,为了执行更快C++优先读取基类的方法,因此在基类声明时,需要将其方法声明为虚方法 #include <iostream> #include <string> using names ...
分类:
编程语言 时间:
2020-07-23 09:16:58
阅读次数:
70
继承的构造函数 一个类只继承其直接基类的构造函数,默认/拷贝/移动构造函数是不能被继承的; 继承Father的构造函数 using Father::Father; //继承Father的构造函数 using让某个名字在当前的作用域可见; //编译器遇到这条代码的时候,会把基类的每个构造函数都生成一个 ...
分类:
编程语言 时间:
2020-07-23 01:42:32
阅读次数:
66
//#include "../Dll1/dll.h" #include <stdio.h> #include <windows.h> #include <strsafe.h> #include <iostream> using namespace std; void ShowError(){ HAN ...
分类:
其他好文 时间:
2020-07-23 01:35:20
阅读次数:
61
https://www.luogu.com.cn/problem/P1223 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n; 4 struct t{ //定义结构体存放等待时间和排队编号 5 int w, no; 6 }; 7 t ...
分类:
其他好文 时间:
2020-07-22 20:56:08
阅读次数:
73
P3919 【模板】可持久化线段树 1(可持久化数组) AC_Code: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn=1e6+10; 5 const int mo ...
分类:
其他好文 时间:
2020-07-22 20:49:10
阅读次数:
77
1.Redis支持的数据类型? Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)。 2.什么是Redis持久化?Redis有哪几种持久化方式?优缺点是什么? redis提供两种方式进行持久化,一种是RD ...
分类:
其他好文 时间:
2020-07-22 20:13:10
阅读次数:
54
//regex_search()的集合是一组匹配集合,通常表示为一个smatch: #include <iostream> #include <fstream> #include <string> #include <regex> using namespace std; void use() { ...
分类:
其他好文 时间:
2020-07-22 15:39:59
阅读次数:
70
做完前四题还有一个半小时... 比赛链接:https://codeforces.com/contest/1382 A. Common Subsequence 题意 给出两个数组,找出二者最短的公共子序列。 题解 最短即长为一。 代码 #include <bits/stdc++.h> using na ...
分类:
其他好文 时间:
2020-07-22 11:10:39
阅读次数:
89
NX9+VS2012 using NXOpen; using NXOpenUI; using NXOpen.UF; using NXOpen.Utilities; private void button1_Click(object sender, EventArgs e) { //锁定UI theU ...
分类:
数据库 时间:
2020-07-22 02:08:52
阅读次数:
174
哈密顿绕行世界问题(HDU-2181) 题解:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 裸DFS; 代码: #include<bits/stdc++.h> using namespace std; const int m ...
分类:
其他好文 时间:
2020-07-22 02:01:11
阅读次数:
198