使用万能头文件 #include<bits/stdc++.h>
#include<bits/stdc++.h>介绍:
最近写编程题时发现了一个神奇的头文件,#include<bits/stdc++.h>,很多人在只要引用了这个头文件之后,就无须再引用其他头文件,百度之后感觉挺有用的,写题时方便快捷(不建议经常使用,如果长期使用容易把库函数名字淡忘掉)
使用:
使用前
#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;
}
如何调用:
- DEV C++软件可直接使用 #include <bits/stdc++.h>
- VS不行,需先在VS中添加此头文件,方法如下
1.在安装路径下,依次进入:
VC --> Tools --> MSVC --> 14.13.26128(此文件夹名每个人会有不同) --> include
大致是这么个方向,但是要以实际情况为准
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\bits
这是别人的
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
这是我的路径
如果实在找不到,建议下一个Everything,全局搜索include,然后进行一个个比对看看哪个目录中含有自己用的头文件(如最常见的stdio.h),就是这个啦
2.在 include 文件夹下新建一个 bits 文件夹,在此文件夹下添加 stdc++.h 头文件,内容就是以下代码块中的代码
// C++ includes used for precompiling -*- C++ -*-// Copyright (C) 2003-2015 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
3. 之后VS 就可以直接添加头文件 #include <bits/stdc++.h> 使用了。
使用万能头文件 #include<bits/stdc++.h>相关推荐
- Visual Studio 中使用万能头文件 #include bits/stdc++.h
进行各种练习赛后,看题解代码时经常会看到这么一个陌生的头文件 #include <bits/stdc++.h> ,这个头文件是一个C++万能头文件,里面包含了程序比赛中所有可能用到的头文件 ...
- C++万能头文件#include“bits/stdc++.h”
最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了. 百度 ...
- 在VS中使用万能头文件#include bits/stdc++.h编译错误的解决方法
2019独角兽企业重金招聘Python工程师标准>>> codeforces已经有过说明.我这里只是把它翻译地更加浅显一点: solution to include bits/std ...
- VScode找不到C++万能头文件<bits/stdc++.h>解决办法
VScode找不到C++万能头文件<bits/stdc++.h>解决办法 一.万能头文件介绍 万能头文件<bits/stdc++> 中包含了 C++中大部分头文件,在大部分做题 ...
- 【C++】万能头文件 <bits/stdc++.h> 的用法和优缺点
[C++]万能头文件 bits/stdc++.h 的用法和优缺点 文章目录 [C++]万能头文件 bits/stdc++.h 的用法和优缺点 一.使用方法 二.头文件的内容 三.VS 中如何使用 四. ...
- 超详细!关于万能头文件<bits/stdc++.h>的细节
万能头文件引言 相信大家在C/C++中一定也遇到过这些情况: 使用系统库函数(如C++<cmath>库,C<math.h>库的开方函数double sqrt(double))和 ...
- 解决vscode头文件<bits/stdc++.h>报错问题
问题背景 在使用VScode时发现万能头文件<bits/stdc++.h>的包含语句下出现红色波浪线,但是能正常运行. #include <bits/stdc++.h> 解决思 ...
- C++头文件<bits/stdc++.h>详解
文章目录 前言 基本用法 内容 优点和缺点 优点 缺点 适用环境 前言 最近学了几节c++编程课,发现老师经常在代码第一行敲上一句: #include <bits/c++std.h> 后来 ...
- 万能头文件#include<bits/stdc++.h>更新GCC10.2.0版本
C++标准库里的万能头文件:#include<bits/stdc++.h> 可用于各大Online Judge测试平台(POJ除外,这些年不维护更新了) 由于网上的都是2014年版的万能头 ...
- c/c++万能头文件#include <bits/stdc++.h>
好奇万能头文件#include <bits/stdc++.h>怎么能够如此强大 直到打开文件发现原来... // C++ includes used for precompiling -* ...
最新文章
- VR Cinema 来了!未来的影院也许是酱紫滴
- 使用cqengine进行集合检索
- HihoCoder - 1591 锦标赛(最大费用最大流)
- php gd png透明,调整PNG大小并将其放在PHP / GD中较大的透明背景上?
- 单例模式-双重检查加锁
- 使用jmap来生成堆转储快照
- 【英语学习】【Daily English】U10 Education L01 Is this certificate a must?
- 跟我一起学Oracle 11g【1】----基础回顾
- read .off file in matlab
- dpkg: error: dpkg status database is locked by another process
- UVA10033 Interpreter【模拟】
- 28335scififo中断接收与发送
- 分布式保存Session 和 StateServer 解决 Session过期
- Windows 下快速删除大量文件的办法
- 后端开发之如何写接口设计文档
- session 修改密码python_django修改密码强制退出机制
- php添加删除div,前端JavaScript-动态添加和删除div元素
- 高通msm8996平台上的pa电源管理(wsa881x)
- App Store上架流程/苹果app发布流程
- 生产者消费者ReentrantLock实现以及BlockingQueue实现
热门文章
- 怎么在线去除图片水印
- 艾司博讯:拼多多千人千面含义及作用
- 钉钉小程序 企业内部应用开发
- 编译postgres exporter遇到的问题解决
- SQL语句 基础排序 单列排序 多列排序 升序降序 基础操作符 where语句 between 高级操作符 AND操作符 OR操作符 IN 和 NOT IN 优先级 Like操作符 模糊匹配 %
- 实习前端工程师的第一天(第一篇)
- java毕业设计校园墙系统mybatis+源码+调试部署+系统+数据库+lw
- hdr与sdr_三张图说明SDR、HDR、伪HDR的区别
- iframe 的优缺点有哪些
- Temporal Fusion Transformer (TFT) 各模块功能和代码解析(pytorch)