生活随笔
收集整理的這篇文章主要介紹了
代码模板
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這是做POJ時為方便測試寫的個模板,貼出來放這兒,以后去POJ水題的時候說不定能用得到。
隱藏行號 復制代碼 ? .cpp
#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;
}
.src_container{background-color:#e7e5dc; width:99%; overflow:hidden; margin:12px 0 12px 0 !important; padding:0px 3px 3px 0px}
.src_container .titlebar{ background-color:#d4dfff; border:1px solid #4f81bd; border-bottom:0; padding:3px 24px; margin:0; width:auto; line-height:120%; overflow:hidden; text-align:left; font-size:12px}
.src_container .toolbar{ display:inline; font-weight:normal; font-size:100%; float:right; cursor:hand; color:#00f; text-align:left; overflow:hidden}
.toolbar span.button{ display:inline; font-weight:normal; font-size:100%; cursor:hand; color:#00f; text-align:left; overflow:hidden; cursor:pointer;}
.src_container div.clientarea{ background-color:white; border:1px solid #4f81bd; margin:0; width:auto !important; width:100%; height:auto; overflow:auto; text-align:left; font-size:12px; font-family: "Courier New","Consolas","Fixedsys",courier,monospace,serif}
.src_container ol.mainarea{ padding:0 0 0 52px; margin:0; background-color:#f7f7ff !important}
.number_show{ padding-left:52px !important; list-style:decimal outside !important}
.number_show li{ list-style:decimal outside !important; border-left:1px dotted #4f81bd}
.number_hide{ padding-left:0px !important; list-style-type:none !important}
.number_hide li{ list-style-type:none !important; border-left:0px}
ol.mainarea li{ display:list-item !important; font-size:12px !important; margin:0 !important; line-height:18px !important; padding:0 0 0 0px !important; background-color:#f7f7ff !important; color:#4f81bd}
ol.mainarea li pre{color:black; line-height:18px; padding:0 0 0 12px !important; margin:0em; background-color:#fff !important}
.linewrap ol.mainarea li pre{white-space:pre-wrap; white-space:-moz-pre-wrapwhite-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word}
ol.mainarea li pre.alt{ background-color:#f7f7ff !important}
<script language="javascript"> function CopyCode(key){var codeElement=null;var trElements=document.all.tags("ol");var i;for(i=0;i
總結
以上是生活随笔為你收集整理的代码模板的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。