1.关于昨天总结的stringstream类,其本需要引入头文件sstream,但是其可以使用万能头文件来代替,即include <bits/stdc++.h>
2.可以使用*(迭代器名)直接访问相应的元素,例如:
set <string> S;
S.insert("test");
cout << *(S.begin());//避免了迭代器遍历,对于单个元素可以简化书写量
3.c++允许对结构体写构造函数
#include <bits/stdc++.h>
using namespace std;
struct T{
int num;
int test;
T(){
num = 123;
test = 456;
}
};
int main(){
T t1 , t2;
cout << t1.num << " " << t2.test;
return 0;
}
4.参悟DFS和BFS
见本人的另外两篇博文DFS和BFS的数组实现
https://blog.youkuaiyun.com/chenhanxuan1999/article/details/84862232
https://blog.youkuaiyun.com/chenhanxuan1999/article/details/84861891