#include <stdio.h>、#include <iostream>、#include <string>、#include <algorithm>、#include <math.h>
这么多复杂的头文件,不仅里面的内容难以理解,而且也非常难记,那么我们如何处理这些头文件?如何方便我们在写代码的时候,不用担心少些了哪些头文件?
下面我来介绍一个万能头文件:#include <bits/stdc++.h>
#include<bits/stdc++.h>包含c/c++中的所有头文件
也就是说只要用#include <bits/stdc++.h>妈妈就再也不用担心的忘记加乱七八糟的头文件了,这个好像并不是所有的oj平台都能用哦!
-----------------------------------------------------
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int n;
scanf(“%d”,&n);
cout<<n<<endl;
return 0;
}
-----------------------------------------------------
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf(“%d”,&n);
cout<<n<<endl;
return 0;
}
-----------------------------------------------------
这两份代码的效果是一模一样的哦!