超级好用的C++万能头文件
#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
转载于:https://www.cnblogs.com/wxmwanggood/p/9330722.html
超级好用的C++万能头文件相关推荐
- 万能头文件#include<bits/stdc++.h>更新GCC10.2.0版本
C++标准库里的万能头文件:#include<bits/stdc++.h> 可用于各大Online Judge测试平台(POJ除外,这些年不维护更新了) 由于网上的都是2014年版的万能头 ...
- c++万能头文件_初学Python,与C对比
✎背景学了一学年的C的基础,下学年开课Python,现在正在自学中...C也不是不学了,而是之前买了一本<C++Primer>在学校里,就准备先学一下Python,下学期利用自由时间接着学 ...
- VScode找不到C++万能头文件<bits/stdc++.h>解决办法
VScode找不到C++万能头文件<bits/stdc++.h>解决办法 一.万能头文件介绍 万能头文件<bits/stdc++> 中包含了 C++中大部分头文件,在大部分做题 ...
- MAC OS下设置bits/stdc++.h万能头文件
在MAC下用atom写c++程序时用到万能头文件会比较方便. 准备: 下载xcode或者command line developer tools 地址:https://developer.apple. ...
- Visual Studio 中使用万能头文件 #include bits/stdc++.h
进行各种练习赛后,看题解代码时经常会看到这么一个陌生的头文件 #include <bits/stdc++.h> ,这个头文件是一个C++万能头文件,里面包含了程序比赛中所有可能用到的头文件 ...
- Visual Studio 中使用万能头文件 #include <bits/stdc++.h>
Visual Studio 中使用万能头文件 #include 前言 最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h> ,但VS中并 ...
- macOS使用C/C++万能头文件保姆级教程
macOS使用C/C++万能头文件保姆级教程 Windows上面用万能头文件为我们省去了不少记头文件的麻烦,切换到macOS上来发现C/C++环境中没有自带这个头文件.不行,今天无论如何都要用到万能头 ...
- VScode添加C++万能头文件
VScode添加C++万能头文件 参考:vscode编译器添加c++万能头文件 使用xcode以及vscode时需要自行添加万能头才可以在代码中使用. 本质都是找到软件中储存库函数的文件夹中再添加一个 ...
- 【C++】万能头文件 <bits/stdc++.h> 的用法和优缺点
[C++]万能头文件 bits/stdc++.h 的用法和优缺点 文章目录 [C++]万能头文件 bits/stdc++.h 的用法和优缺点 一.使用方法 二.头文件的内容 三.VS 中如何使用 四. ...
最新文章
- c语言组队,组队列问题。会做的高手帮帮忙啊
- win7的vmware中安装ubuntu 13.04看不到共享目录
- 九大经典算法之选择排序、堆排序
- android和ios系统的内存,WP和Saipan系统的流畅程度相当于ios,占用的内存很少,但是为什么要用Android取代它...
- [转]Android 之 Window、WindowManager 与窗口管理
- outlook与shairepoint2010 数据同步
- 【NLP】揭秘马尔可夫模型神秘面纱系列文章(二)
- 携程线上测评测试题目,答案解析
- 洛谷P1308 统计单词数
- Texture tiling
- 干货|2021年以后人工智能的几点思考?
- 信息服务器v6,服务器ipv6设置
- 集线器、中继器、网桥、交换机、网关、路由器——今天必把你们区分开
- 怎么恢复电脑删除的文件,误删除数据恢复
- linux提取手机rom,提取安卓手机ROM固件中的APP
- kingcms企业(php) 9.0下载,[下载]地方门户 9.0(K9地方门户版)_KingCMS官方网站
- DPlayer视频播放器使用方法介绍
- 成为Java顶尖程序员 ,看这12本书就够了
- 风控模型评估指标:KS、ROC、AUC、PSI代码逻辑
- 浏览器Cookie大小、个数限制
热门文章
- 中国区块链标准建设分析
- 使用python绘制二元函数对应的曲面
- 解决58同城使用font-face进行字符替换
- sklearn波士顿房价数据集——线性回归
- 有什么方法可以查看网站使用的是那个wordpress主题
- 30个T的硬盘都不够装,你想要的资源都在这里
- android xml 加载错误提示,加载uixml文件失败 打开wps时显示“加载XML文件失败1
- 国六OBD在线排放监测终端拆解成本分析,你是不是买贵了?
- hp 高性能服务器,高密度 高性能 惠普ML110 G7服务器评测
- 腾讯、阿里、百度等互联网巨头究竟如何布局元宇宙的?