⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printdate.cc

📁 c++编写的并行拉马克遗传算法的程序。实现分析对接程序
💻 CC
字号:
/* printdate.cc */#ifdef sgi    #include <stdio.h>    #include <sys/types.h>    #include <sys/time.h>    #include <time.h>    #include "printdate.h"#else    extern "C"    {          #include <stdio.h>          #include <sys/types.h>          #include <sys/time.h>          #include <time.h>        #include "printdate.h"    }#endifvoid printdate( FILE *fp, int flag ){    time_t tn; /* tn = "time_now" */    char *StringTimeDate;    struct tm *ts;    tn = time( &tn );    ts = localtime( &tn );        if (flag==1) {        fprintf(fp, "%d:%02d %02d\" %s, %02d/%02d/%02d\n",         ( (ts->tm_hour >  12) ? (ts->tm_hour-12) : ts->tm_hour ), ts->tm_min, ts->tm_sec,        ( (ts->tm_hour >= 12) ? "p.m." : "a.m." ),        (ts->tm_mon + 1), ts->tm_mday, ts->tm_year );    } else if (flag==2) {          StringTimeDate = ctime( &tn );          fprintf(fp, "%s", StringTimeDate);    } else {        fprintf(fp, "%d:%02d %02d\" %s\n",         ( (ts->tm_hour >  12) ? (ts->tm_hour-12) : ts->tm_hour ), ts->tm_min, ts->tm_sec,        ( (ts->tm_hour >= 12) ? "pm" : "am" ) );    }}/* EOF */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -