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

}

可以直接转化为:

#include<bits/stdc++.h>

using namespace std;

int main()

return 0;

}

兼容性问题:

注意,目前POJ还不支持<bits/stdc++.h>(G++、C++都不支持)。HDU部分支持(G++支持,C++不支持)。

其他国外的oj,还有台湾的oj都支持,CF,Topcoder也都支持。

当然,其实这是一个偷懒的写法,但是会降低编译速度(为何会降低编译速度,我还不能知道,等到之后学编译原理再来填坑吧)。

笔试平台可以使用,方便,VS中并不支持,一般G++ 4.4以上就支持这个头文件了。当然,私下自己学习就不要去使用了,对你的自主学习一点都没有好处。

c++11支持这个

po上<bits/stdc++.h>的源代码

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2014 Free Software Foundation, Inc.//// This file is part of the GNU ISO C++ Library.  This library is free// software; you can redistribute it and/or modify it under the// terms of the GNU General Public License as published by the// Free Software Foundation; either version 3, or (at your option)// any later version.

// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional// permissions described in the GCC Runtime Library Exception, version// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and// a copy of the GCC Runtime Library Exception along with this program;// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see// <http://www.gnu.org/licenses/>.

/** @file stdc++.h

*  This is an implementation file for a precompiled header.

*/

// 17.4.1.2 Headers

// C#ifndef _GLIBCXX_NO_ASSERT

#include <cassert>#endif

#include <cctype>

#include <cerrno>

#include <cfloat>

#include <ciso646>

#include <climits>

#include <clocale>

#include <cmath>

#include <csetjmp>

#include <csignal>

#include <cstdarg>

#include <cstddef>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#if __cplusplus >= 201103L

#include <ccomplex>

#include <cfenv>

#include <cinttypes>

#include <cstdalign>

#include <cstdbool>

#include <cstdint>

#include <ctgmath>

#include <cwchar>

#include <cwctype>#endif

// C++

#include <algorithm>

#include <bitset>

#include <complex>

#include <deque>

#include <exception>

#include <fstream>

#include <functional>

#include <iomanip>

#include <ios>

#include <iosfwd>

#include <iostream>

#include <istream>

#include <iterator>

#include <limits>

#include <list>

#include <locale>

#include <map>

#include <memory>

#include <new>

#include <numeric>

#include <ostream>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <stdexcept>

#include <streambuf>

#include <string>

#include <typeinfo>

#include <utility>

#include <valarray>

#include <vector>

#if __cplusplus >= 201103L

#include <array>

#include <atomic>

#include <chrono>

#include <condition_variable>

#include <forward_list>

#include <future>

#include <initializer_list>

#include <mutex>

#include <random>

#include <ratio>

#include <regex>

#include <scoped_allocator>

#include <system_error>

#include <thread>

#include <tuple>

#include <typeindex>

#include <type_traits>

#include <unordered_map>

#include <unordered_set>#endif

超级好用的C++万能头文件的更多相关文章

  1. C++万能头文件的秘密

    #include<bits/stdc++.h> 万能头文件,拼写怎么这么奇怪? 其实,bits表示一个文件夹,stdc++.h是里面的头文件,这表示路径. 搜索这个文件夹,找到后打开. 打 ...

  2. Opencv各个版本的万能头文件

    每次下载opencv的新版本时,都需要重新写头文件,更改链接库配置,很麻烦有木有?下面这个头文件是我在别人的代码中淘出来的,很不错,与大家分享~(具体作者忘记了,不好意思啊) 作者很巧妙地利用Open ...

  3. 万能头文件#include

    #include<bits/stdc++.h>包含了目前c++所包含的所有头文件!!!! 测试结果POJ不支持HDU,NYOJ支持

  4. Visual Studio 中使用万能头文件 #include <bits/stdc++.h>

    最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h>  ,但VS中并没有,为了使用方便,可直接在VS中添加此头文件,方法如下: 1.在安 ...

  5. 万能头文件#include <bits/stdc++.h>

    最近在做题的时候看到别人的题解发现别人都用这个 突然之间打开新世界的大门 去百度之后才知道#include <bits/stdc++.h>包含了目前所有的c++头文件 也就是说只要用#in ...

  6. 万能头文件#include<bits/stdc++.h>

    最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了. 百度 ...

  7. C++万能头文件<bits/stdc++.h>的内容与优缺点

    最近发现了一个C++的头文件bits/stdc++.h,听说这是一个几乎包含了所有C++库函数的头文件,就想更深入的了解一下,下面是头文件内容 // C++ includes used for pre ...

  8. gcc中C++一个特别的头文件

    今天在一段程序中看到这样一个很奇怪的语句: #include<bits/stdc++.h> 博主查了之后发现业界称其万能头文件,这个头文件包含了如下等头文件,几乎包含了所有的C++标准库头 ...

  9. ACM竞赛常用头文件模板-备忘

    备忘. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> ...

随机推荐

  1. 星系炸弹|2015年蓝桥杯B组题解析第二题-fishers

    星系炸弹 在X星系的广袤空间中漂浮着许多X星人造"炸弹",用来作为宇宙中的路标. 每个炸弹都可以设定多少天之后爆炸. 比如:阿尔法炸弹2015年1月1日放置,定时为15天,则它在2 ...

  2. POJ 1679 The Unique MST (次小生成树)题解

    题意:构成MST是否唯一 思路: 问最小生成树是否唯一.我们可以先用Prim找到一棵最小生成树,然后保存好MST中任意两个点i到j的这条路径中的最大边的权值Max[i][j],如果我们能找到一条边满足 ...

  3. acm模板生成

    为迎接,接下来的区域赛,要做好准备(虽然不是特别有信心,但是还是要鼓励自己,可以取得收获的,加油) acm_latex模板: https://www.cnblogs.com/palayutm/p/64 ...

  4. FAST:通过Floodlight控制器下发流表

    参考: Floodlight+Mininet搭建OpenFlow(四):流表操作 通过Floodlight控制器下发流表 下发流表的方式有两种: 1.借助Floodlight的北向API,利用curl ...

  5. tornado 如何向html传list变量啊?

    py: html:

  6. navicat Window . MAC版常用快捷键

    navicat 结合快捷键 1.ctrl+q 打开查询窗口 2.ctrl+/ 注释sql语句 3.ctrl+shift +/ 解除注释 4.ctrl+r 运行查询窗口的sql语句 5.ctrl+shi ...

  7. UOJ #79. 一般图最大匹配

    板子: #include<iostream> #include<cstdio> #include<algorithm> #include<vector> ...

  8. bash Shell 中如何实现条件判断之if判断

    http://blog.51cto.com/lovelace/1211353 bash中如何实现条件判断?条件测试类型:    整数测试    字符测试    文件测试 一.条件测试的表达式:     ...

  9. MongoDB(课时6 关系查询)

    支持关系查询操作:大于($gt),小于($lt),大于等于($gte),小于等于($lte),不等于($ne ),等于(key:value 或 $eq).想让这些操作正常使用,需要准备一个数据集合. ...

  10. np.linspace

    来自:有一种宿命叫无能为力 在指定的间隔内返回均匀间隔的数字.(返回num个样本数据,在[start, stop]). 函数形式: linspace(start, stop, num = 50, en ...