一個包含所有c++的標頭檔案的標頭檔案
阿新 • • 發佈:2018-12-26
#include <bits/stdc++.h>
做CF看見別人用這個函式,然後就能直接用vector,set,string那些函數了,摸不著頭腦,感覺特神奇就百度了一下,才發現這個是C++版本升級,然後檔案自帶的,方便了程式設計師吧。不然每次都得敲那模板老長……
使用和平常的標頭檔案一樣,如下:
#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a+b<<endl; return 0; }
#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>
等等……
不過在國內oj中,poj,hdu 不支援這個函式,這幾個oj的編譯器問題,其他國外的oj,還有臺灣的oj都支援,CF,Topcoder也都支援