c++模板文件,方便调试与运行时间的观察

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include <cstdio>
#include <queue>
#include<stack>

#include<stdlib.h>

#define Watch_RunTime 1
#if Watch_RunTime
#include <ctime>
int start_time;
#endif

#define Max 3000
#define debug 1
using namespace std;


int main() {
#if debug
    freopen("in.txt", "r", stdin);//由文件输入
#endif
#if Watch_RunTime
    start_time = clock();
#endif



#if debug
    freopen("CON", "r", stdin);//由控制台输入,为了下面的system pause可以显示并退出
#endif
#if Watch_RunTime
    cout << " ------- ";
    cout << clock() - start_time <<"ms";
#endif

    system("pause>nul");
    return 0;
}

原文地址:https://www.cnblogs.com/lxzbky/p/10547189.html