您的位置:首页 > 编程语言 > C语言/C++

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

2014-09-03 21:44 316 查看

偶然在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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: