Bootstrap

程序员们梦寐以求的头文件 <bits/stdc++.h>

偶然在CF上做题,在借鉴别人代码的时候,看到了这个神奇的头文件,生平第一次见。。。

然后就稍稍地百度了一下,才知道它这么腻害,竟然包含了C++的所有头文件!


使用和往常的头文件一样:


    #include<bits/stdc++.h>  
    using namespace std;  
    int main()  
    {  
        int a,b;  
        cin>>a>>b;  
        cout<<a+b<<endl;  
        return 0;  
    }  


#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>

等等……


不过在国内oj中,poj,hdu 不支持这个函数,这几个oj的编译器问题,其他国外的oj,还有台湾的oj都支持,CF,Topcoder也都支持。


参考博客:http://blog.kuoe0.tw/posts/2014/01/31/install-gnu-gcc-on-os-x-and-use-the-header-bits-stdcplusplus-h-and-policy-based-data-structure

;