天天看點

【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>
#include<stdio.h>
           

等等超多的頭檔案!

include <bits/stdc++.h>
using  namespace std;
int main()
{
    int a=1;
    int b=2;
    cin>>a;
    cin>>b;
    cout<<"a*b="<<a*b;
    return 0;
}
           

也就是說,當你不知道一些C++庫裡的一些函數不知道是什麼庫的時候,就可以寫上這個頭檔案,也就可以省一些力!

繼續閱讀