C++头文件


在刷题时,总发现有的只写一行头文件 #include <bits/stdc++.h> 。

查阅资料后,才知道原来:#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;
}

等我们使用了stdc++.h后,同样的代码可以写成:

#include<bits/stdc++.h>
using namespace std;

int main(){
    
    return 0;
}

爱刷题的同学们有福了,大部分oj都支持它,但也有个别暂时不支持哦,自己测试吧。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM