这是做POJ时为方便测试写的个模板,贴出来放这儿,以后去POJ水题的时候说不定能用得到。
#define DEBUG
#include
using std::cin;
using std::cout;
using std::endl;
#ifdef DEBUG
#include
#include
using std::string;
using std::freopen;
string input_file_name = __FILE__;
#endif
//here add other file need to included, and declare namespace need to use.
//here declare global variables;
//here add funtions.
int main(int argc, char* argv[])
{
#ifdef DEBUG
if(!freopen((input_file_name.substr(0, input_file_name.size() - 4) + ".in").c_str(), "r", stdin))
{ cout << "input data error, not found input file." << endl; return -1; }
#endif
//here add code for solve problem.
//input
//output
#ifdef DEBUG
double time_elapsed = clock() / CLOCKS_PER_SEC;
printf("%d ms./n", (int)(time_elapsed * 1000));
#endif
return 0;
}