摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 string t[100]; 4 int tot=0; 5 int to_num(string &s) 6 { 7 int x=0,f=1; 8 for(auto &p:s) 9 { 10 if(p 阅读全文
posted @ 2021-12-08 22:55 matt-11 阅读(291) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 #define mytest 3 using namespace std; 4 const int N=1e5+5; 5 const int mod=1337; 6 int h[N];//h[i]表示key为i的开头节点编号 7 int tot 阅读全文
posted @ 2021-12-08 21:36 matt-11 阅读(77) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 char st[33],top; 4 int change_ten(int d) 5 { 6 int x=0; 7 for(int i=1;i<=top;i++) 8 { 9 if(st[i]>=' 阅读全文
posted @ 2021-12-08 21:33 matt-11 阅读(18) 评论(0) 推荐(0)
摘要: day 6. 类的权限 class mydata { public: void get(int x) { i=x; cout<<i<<endl; } private:int i;//默认私有 } ; int main() { mydata d1; d1.i=1;//这里是禁止访问的,因为i是私有成员 阅读全文
posted @ 2021-12-05 22:34 matt-11 阅读(42) 评论(0) 推荐(0)
摘要: day 5. 引用的本质是指针实现的,所有类型的指针都是四字节; 右值引用也能改变内存实体 int main() { int a(4); int && numr(move(a));//a是左值,移动语义把左值变右值 numr=1; cout<<numr<<" "<<a<<endl;//都是1,右值引 阅读全文
posted @ 2021-12-04 22:36 matt-11 阅读(43) 评论(0) 推荐(0)
摘要: day4 可变参数模板 #include<cstdarg> tempate<typename T,typename...Args> // #include<bits/stdc++.h>using namespace std; void show(){//递归结束需要的程序,相当于重载 }templa 阅读全文
posted @ 2021-12-03 22:44 matt-11 阅读(47) 评论(0) 推荐(0)
摘要: day 3.mutable需要注意的是:mutable不能修饰const 和 static 类型的变量。我们知道,被const关键字修饰的函数的一个重要作用就是为了能够保护类中的成员变量。即:该函数可以使用类中的所有成员变量,但是不能修改他们的值。然而,在某些特殊情况下,我们还是需要在const函数 阅读全文
posted @ 2021-12-02 22:52 matt-11 阅读(37) 评论(0) 推荐(0)
摘要: 构造函数 用途:用来初始化类对象的数据成员; 构造函数和类名相同,没有返回值,可以有多个构造函数 不同的构造函数形参数量或者类型要有所区别 构造函数不能声明成const,因为构造函数要对数据成员进行赋值,而且类对象获得const属性是在构造函数完成之后 默认构造函数没有任何参数,如果我们没有声明任何 阅读全文
posted @ 2021-12-01 22:57 matt-11 阅读(38) 评论(0) 推荐(0)
摘要: 字符数组初始化字符串会默认添加\0,要注意数组下标大小例如 char a[]="123",要开到4;C数组 int a[]不能拷贝和赋值;如a2=a,int a2[]=a //错误int *a[10] //a是指向10个int *int (*a)[10] //指向10个int型的数组指针int a[ 阅读全文
posted @ 2021-11-30 20:25 matt-11 阅读(36) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int dp[205][5050]; 4 int v[205],w[205]; 5 int n,k; 6 int main() 7 { 8 //cout<< log(1e18)/log(5)<<en 阅读全文
posted @ 2021-11-29 21:51 matt-11 阅读(51) 评论(0) 推荐(0)