在刷算法题时,经常会遇到  #include<bits/stdc++.h>  这个头文件,该头文件是一个常用的C++万能头文件,里面包含了几乎所有的C++头文件。该万能头文件所在的文件夹叫  bits  ,如果打开 include 文件夹 -> bits 文件夹,就能看见里面的stdc++.h  。

当我们忘记函数包含在哪个头文件下时或者头文件包含较多时,可以使用这个万能头文件来代替。但这个头文件也有缺点,最明显的是使用后编译时间太长。另外,由于  bits/stdc++.h  不是C++的标准头文件,所以会有少部分编译器不支持。

#include<bits/stdc++.h>  包含了目前C++所包含的所有头文件,里面的内容为:

Code:

// 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++)万能头文件#include<bits/stdc++.h>相关推荐

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

    进行各种练习赛后,看题解代码时经常会看到这么一个陌生的头文件 #include <bits/stdc++.h> ,这个头文件是一个C++万能头文件,里面包含了程序比赛中所有可能用到的头文件 ...

  2. C++万能头文件#include“bits/stdc++.h”

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

  3. 在VS中使用万能头文件#include bits/stdc++.h编译错误的解决方法

    2019独角兽企业重金招聘Python工程师标准>>> codeforces已经有过说明.我这里只是把它翻译地更加浅显一点: solution to include bits/std ...

  4. VScode找不到C++万能头文件<bits/stdc++.h>解决办法

    VScode找不到C++万能头文件<bits/stdc++.h>解决办法 一.万能头文件介绍 万能头文件<bits/stdc++> 中包含了 C++中大部分头文件,在大部分做题 ...

  5. 【C++】万能头文件 <bits/stdc++.h> 的用法和优缺点

    [C++]万能头文件 bits/stdc++.h 的用法和优缺点 文章目录 [C++]万能头文件 bits/stdc++.h 的用法和优缺点 一.使用方法 二.头文件的内容 三.VS 中如何使用 四. ...

  6. 超详细!关于万能头文件<bits/stdc++.h>的细节

    万能头文件引言 相信大家在C/C++中一定也遇到过这些情况: 使用系统库函数(如C++<cmath>库,C<math.h>库的开方函数double sqrt(double))和 ...

  7. 解决vscode头文件<bits/stdc++.h>报错问题

    问题背景 在使用VScode时发现万能头文件<bits/stdc++.h>的包含语句下出现红色波浪线,但是能正常运行. #include <bits/stdc++.h> 解决思 ...

  8. C++头文件<bits/stdc++.h>详解

    文章目录 前言 基本用法 内容 优点和缺点 优点 缺点 适用环境 前言 最近学了几节c++编程课,发现老师经常在代码第一行敲上一句: #include <bits/c++std.h> 后来 ...

  9. 万能头文件#include<bits/stdc++.h>更新GCC10.2.0版本

    C++标准库里的万能头文件:#include<bits/stdc++.h> 可用于各大Online Judge测试平台(POJ除外,这些年不维护更新了) 由于网上的都是2014年版的万能头 ...

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

    好奇万能头文件#include <bits/stdc++.h>怎么能够如此强大 直到打开文件发现原来... // C++ includes used for precompiling -* ...

最新文章

  1. python最大堆_用Python实现最大堆
  2. iwrite提交不了作业_iWrite英语写作教学与评阅系统移动端——学生使用手册
  3. java 数组存入数据库_Java中关于二维数组的理解与使用
  4. php class类 教程,PHP类(Class)入门教程第2/2页
  5. 《Web安全之机器学习入门》一 第3章 机器学习概述
  6. Mybatis+Tomcat使用JNDI配置数据源入门
  7. 通过Zoopkeeper-BinaryOutputArchive类学习utf-8的实现
  8. 新款iPhone现已曝光,跟风华为“浴霸三摄”,没有5G版本
  9. ffmpeg加水印、logo等
  10. python头像教程_教你用 Python 生成一张全体微信好友的头像墙
  11. caj 获取my documents目录错误,可能“我的文档”目录不存在
  12. BT宝塔面板安装流程(图文教程)
  13. spring-环绕通知 @Around
  14. 使用do…while循环语句计算正数5的阶乘
  15. 安卓开发:实现调用相机拍照
  16. JdbcTemplate增删改查总结
  17. JZOJ5953. 【NOIP2018模拟11.5A组】生死之境
  18. mysql 原子自增_mysql自增锁_33
  19. 计算机专业不需要专业背景吗,澳洲哪些大学计算机专业不需要专业背景?众多澳洲名校你pick哪个?...
  20. JavaScript(JS)(一)

热门文章

  1. iOS 发送邮件SKPSMTPMessage
  2. 【ASO潜规则】之改名克隆 疯狂圈钱
  3. 使用mongoose模块向本地mongodb数据库中插入数据报错“Operation `people.insertOne()` buffering timed out after 10000ms“
  4. 怎么批量添加微信好友?
  5. 海店湾养生专家教你:牛奶14种妙用,滋补气血抗衰老!
  6. 在Moto Atrix4G手机里安装全功能Ubuntu记录(特附友情广告一则)
  7. YOLOv5实现佩戴安全帽检测和识别(含佩戴安全帽数据集+训练代码)
  8. 怎么查看公众号文章被转载的数量
  9. Python -- Matplotlib库的使用
  10. 联想启天m410电脑U盘重装win10系统教程