本机环境:win10系统 64位 vs2017

最近码代码时偶然发现了bits/stdc++.h这个头文件(万能头文件),基本上所有的代码只要用了这个头文件就不再写其他头文件了。

看到它就仿佛开启了新世界(也有缺点,就是导致编译速度变慢,不过一般可以忽略不计)。
【如果安装了MinGW的直接在文件夹里面找到bits这个文件夹,把里面内容复制粘贴到vs的头文件库里面】

1 .新建txt文档,把以下代码(stdc++.h源码)复制进去:

  1. // C++ includes used for precompiling -*- C++ -*-
  2.  
  3. // Copyright (C) 2003-2015 Free Software Foundation, Inc.
  4. //
  5. // This file is part of the GNU ISO C++ Library. This library is free
  6. // software; you can redistribute it and/or modify it under the
  7. // terms of the GNU General Public License as published by the
  8. // Free Software Foundation; either version 3, or (at your option)
  9. // any later version.
  10.  
  11. // This library is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15.  
  16. // Under Section 7 of GPL version 3, you are granted additional
  17. // permissions described in the GCC Runtime Library Exception, version
  18. // 3.1, as published by the Free Software Foundation.
  19.  
  20. // You should have received a copy of the GNU General Public License and
  21. // a copy of the GCC Runtime Library Exception along with this program;
  22. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  23. // <http://www.gnu.org/licenses/>.
  24.  
  25. /** @file stdc++.h
  26. * This is an implementation file for a precompiled header.
  27. */
  28.  
  29. // 17.4.1.2 Headers
  30.  
  31. // C
  32. #ifndef _GLIBCXX_NO_ASSERT
  33. #include <cassert>
  34. #endif
  35. #include <cctype>
  36. #include <cerrno>
  37. #include <cfloat>
  38. #include <ciso646>
  39. #include <climits>
  40. #include <clocale>
  41. #include <cmath>
  42. #include <csetjmp>
  43. #include <csignal>
  44. #include <cstdarg>
  45. #include <cstddef>
  46. #include <cstdio>
  47. #include <cstdlib>
  48. #include <cstring>
  49. #include <ctime>
  50.  
  51. #if __cplusplus >= 201103L
  52. #include <ccomplex>
  53. #include <cfenv>
  54. #include <cinttypes>
  55. #include <cstdalign>
  56. #include <cstdbool>
  57. #include <cstdint>
  58. #include <ctgmath>
  59. #include <cwchar>
  60. #include <cwctype>
  61. #endif
  62.  
  63. // C++
  64. #include <algorithm>
  65. #include <bitset>
  66. #include <complex>
  67. #include <deque>
  68. #include <exception>
  69. #include <fstream>
  70. #include <functional>
  71. #include <iomanip>
  72. #include <ios>
  73. #include <iosfwd>
  74. #include <iostream>
  75. #include <istream>
  76. #include <iterator>
  77. #include <limits>
  78. #include <list>
  79. #include <locale>
  80. #include <map>
  81. #include <memory>
  82. #include <new>
  83. #include <numeric>
  84. #include <ostream>
  85. #include <queue>
  86. #include <set>
  87. #include <sstream>
  88. #include <stack>
  89. #include <stdexcept>
  90. #include <streambuf>
  91. #include <string>
  92. #include <typeinfo>
  93. #include <utility>
  94. #include <valarray>
  95. #include <vector>
  96.  
  97. #if __cplusplus >= 201103L
  98. #include <array>
  99. #include <atomic>
  100. #include <chrono>
  101. #include <condition_variable>
  102. #include <forward_list>
  103. #include <future>
  104. #include <initializer_list>
  105. #include <mutex>
  106. #include <random>
  107. #include <ratio>
  108. #include <regex>
  109. #include <scoped_allocator>
  110. #include <system_error>
  111. #include <thread>
  112. #include <tuple>
  113. #include <typeindex>
  114. #include <type_traits>
  115. #include <unordered_map>
  116. #include <unordered_set>
  117. #endif

2.把txt文档改名stdc++.h

3.打开vs2017的安装目录

  1. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include

格式类似上面

在“include”目录下新建文件夹“bits”,然后把刚才的bits/stdc++.h移入。

4. 大功告成

详细步骤:手动添加bits/stdc++.h到vs2017

详细步骤:手动添加bits/stdc++.h到vs2017的更多相关文章

  1. 为VisualStudio2017添加bits/stdc++.h

    在算法编程中经常有人只写一个头文件"bits/stdc++.h" 其实这个是很多头文件的集合,写了它后相当于包含了所有常用的C++头文件,可是需要注意的是并不是所有的OJ系统都支持 ...

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

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

  3. C++ 中头文件<bits/stdc++.h>的优缺点

    在编程竞赛中,我们常见一个头文件: #include <bits/stdc++.h> 发现它是部分C++中支持的一个几乎万能的头文件,包含所有的可用到的C++库函数,如<istrea ...

  4. 高级c++头文件bits/stdc++.h

    用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #includ ...

  5. 2.头文件<bits/stdc++.h>

    用这种方法声明头文件只需两行代码 #include<bits/stdc++.h> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件:  #inclu ...

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

    一句话的事,直截了当——#include<bits/stdc++.h>包含C++的所有头文件 参考网站(点击):http://www.tuicool.com/articles/m6neUj ...

  7. #include<bits/stdc++.h>

    在听学长讲课时看到了#include<bits/stdc++.h>这个头文件,瞬间懵逼辣,百度后了解了 #include<bits/stdc++.h>,包含了C++的所有头文件 ...

  8. <bits/stdc++.h>头文件介绍(包含源代码)

    注:转自http://blog.csdn.net/charles_dong2/article/details/56909347,同为本人写的,有部分修改. 之前在一个小OJ上刷题时发现有人是这么写的: ...

  9. #include<bits/stdc++.h>的使用

    #include<bits/stdc++.h>包含了C++里面所有的库函数,因此在写任何程序的时候只需要加上#include<bits/stdc++.h>即可.

随机推荐

  1. 前端——JS

    目录 JavaScript概述 ECMAScript和JavaScript的关系 ECMAScript的历史 JavaScript引入方式 Script标签内写代码 引入额外的JS文件 JavaScr ...

  2. web服务器调用Servlet的过程

    Servlet程序是由WEB服务器调用,web服务器收到客户端的Servlet访问请求后: Web服务器首先检查是否已经装载并创建了该Servlet的实例对象.如果是,则直接执行第④步,否则,执行第② ...

  3. mysql主从之配置基本环境

    实验环境 master  192.168.132.121 主库 slave     192.168.132.122 从库 一 mysql的使用介绍 1.1 mysql单台服务器特点 缺点 单台服务器如 ...

  4. ES6学习----let、const、解构赋值、新增字符串、模板字符串、Symbol类型、Proxy、Set

    这篇es6的学习笔记来自于表哥 表严肃,是我遇到过的讲课最通透,英文发音最好听的老师,想一起听课就去这里吧 https://biaoyansu.com/i/hzhj1206 ES6就是JS6,JS的第 ...

  5. Python for Data Analysis 学习心得(一) - numpy介绍

    一.简介 Python for Data Analysis这本书的特点是将numpy和pandas这两个工具介绍的很详细,这两个工具是使用Python做数据分析非常重要的一环,numpy主要是做矩阵的 ...

  6. Huffman树及其编码(STL array实现)

    这篇随笔主要是Huffman编码,构建哈夫曼树有各种各样的实现方法,如优先队列,数组构成的树等,但本质都是堆. 这里我用数组来存储数据,以堆的思想来构建一个哈弗曼树,并存入vector中,进而实现哈夫 ...

  7. Linux磁盘管理之LVM逻辑卷快照

    一.快照的工作原理 所谓快照就是将当时的系统数据记录下来,在未来若有数据变动,则会将变更前的数据放入快照区进行保存.我们可理解为快照就是给系统拍了一张照片,记录当时系统在拍快照的状态.只不过现实生活中 ...

  8. Python学习中的“按位取反”笔记总结

    | 疑惑 最近在学习Python的过程中了解到位运算符,但对于按位取反有点迷糊,就比如说~9(按位取反)之后的结果是-10,为什么不是6呢?所以下面就来看看为什么不是6,正确结果是如何计算出来的呢? ...

  9. 全流程开发 TP6.0实战高并发电商服务系统*完

    在TP6框架中我们可以学到TP整体知识,如下图一所示: 图一:TP6整体知识点 这些内容都会在实战课程中一一涵盖,并且在课程中我们会用到五层架构思想(如图二),和传统的MVC架构有所不一样,这样做可以 ...

  10. 让vue-router渲染为指定的标签

    <router-link :to="{name:'cart'}" tag="li"> cart </router-link> 在rout ...