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