用这种方法声明头文件只需两行代码
#include<bits/stdc++.h>
using namespace std;
这个头文件包含以下等等C++中包含的所有头文件:
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <iostream>
等等……
但是部分OJ站可能不支持这种写法
已知c++11支持这个
补充:已知的弊端是,用这种方法声明库,写代码过程中,DEVc++的代码补全功能不会被激活

本文介绍了一种使用<bits/stdc++.h>头文件来快速引入C++标准库的方法,该方法仅需两行代码即可完成所有标准库的声明。但需要注意的是,此方法可能不适用于所有在线评测平台,并且在某些IDE中可能会导致代码补全功能失效。
4万+

被折叠的 条评论
为什么被折叠?



