#include <bits/stdc++.h> //万能头文件
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <float.h>
#include <ctype.h>
#include <map>
#include <stdbool.h>
#include <windows.h>
相对于这些头文件,万能头简洁易记易写,更为实用。
但万能头一定就好吗?
#include <bits/stdc++.h>
using namespace std;
int y1;
int main() {
scanf("%d", &y1);
printf("%d", y1);
return 0;
}
这段代码是不能运行的。因为在
#include <cmath>
里用过了 y1
这个变量。
万能头的第一个缺点:
污染命名空间
指不定在那处就会卡常。
万能头的第二个缺点:
有些比赛禁用。
但如果实在记不起
#include <algorithm>
#include <stdbool.h>
还是用吧。