在刷題時,總發現有的只寫一行頭文件 #include <bits/stdc++.h> 。
查閱資料后,才知道原來:#include<bits/stdc++.h>包含了目前c++所包含的所有頭文件!
如下代碼:
#include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include <deque> #include <vector> #include <queue> #include <string> #include <cstring> #include <map> #include <stack> #include <set> using namespace std; int main(){ return 0; }
等我們使用了stdc++.h后,同樣的代碼可以寫成:
#include<bits/stdc++.h> using namespace std; int main(){ return 0; }
愛刷題的同學們有福了,大部分oj都支持它,但也有個別暫時不支持哦,自己測試吧。