在算法编程中经常有人只写一个头文件"bits/stdc++.h"

其实这个是很多头文件的集合,写了它后相当于包含了所有常用的C++头文件,可是需要注意的是并不是所有的OJ系统都支持这个头文件,因此在做编程题是可能并不是使用这个头文件.

另外VS也没有这个头文件,不过这个简单,我们可以自己手动建一个.

在VS的安装目录,VS2017的目录是C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include,别的版本也类似,在这个目录下新建文件夹bits,里面新建stdc++.h,

stdc++.h的内容:

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

然后就可以在VS里用

#include <bits/stdc++.h>

一次性包含所有头文件

为VisualStudio2017添加bits/stdc++.h的更多相关文章

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

    本机环境:win10系统 64位 vs2017 最近码代码时偶然发现了bits/stdc++.h这个头文件(万能头文件),基本上所有的代码只要用了这个头文件就不再写其他头文件了. 看到它就仿佛开启了新 ...

  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> using namespace std; 这个头文件包含以下等等C++中包含的所有头文件: #includ ...

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

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

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. Android 8 蓝牙 扫描流程

    记录android 8 蓝牙扫描设备的流程 src/com/android/settings/bluetooth/BluetoothSettings.java @Override protected ...

  2. bootstrap 列表組

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  3. MTK LCM的添加

    对于LCM驱动移植,一般分为三部曲: 1.硬件IO口配置: 2.确保LCM背光能够正常点亮: 3.LCM驱动移植: 硬件电路: 1.GPIO配置 打开 mediatek\dct\DrvGen.exe ...

  4. timer计算两个方法执行时间

    >>> from timeit import Timer >>> Timer("temp = x; x = y; y = temp", &quo ...

  5. dir 命令手册

    dir 命令手册 参数 /A D 目录 R 只读文件 H 隐藏文件 A 准备存档的文件 S 系统文件 - 表示"否"的前缀 /B 使用空格式(没有标题信息或摘要) /C 在文件大小 ...

  6. 【html5】 解决 video标签 不自动全屏

    <video controls="controls" poster='' src='' preload="auto" x5-playsinline=&qu ...

  7. 一、K3 WISE 开发插件《K3 WISE常用数据表整理》

    在后台数据库ICClassType表中,字段FID<0的是老单,FID>0的是新单. ----------------系统设置------------------------FStatus ...

  8. 如何判断java对象是否为String数组

    if (entry.getValue() instanceof String[]) {// ko .................... }

  9. python学习中的bug

    1.在pycharm的terminal中的python工程目录下update pip失败,但是在cmd中为什么就可以.’

  10. react 动态修改 document.title

    装饰器 // withComponents/withHeaderBar.js import React, { Component } from "react"; import He ...