千萬建筑資料下載 →
經(jīng)典C語言程序設(shè)計(jì)100例91-100
【程序91】
題目:時間函數(shù)舉例1
1.程序分析:
2.程序源代碼:
#include "stdio.h"
#include "time.h"
void main()
{ time_t lt; /*define a longint time varible*/
lt=time(NULL);/*system time and date*/
printf(ctime(<)); /*english format output*/
printf(asctime(localtime(<)));/*tranfer to tm*/
printf(asctime(gmtime(<))); /*tranfer to Greenwich time*/
}
-----------------------------------------------------------------------------
【程序92】
題目:時間函數(shù)舉例2
1.程序分析:
2.程序源代碼:
/*calculate time*/
#include "time.h"
#include "stdio.h"
main()
{ time_t start,end;
int i;
start=time(NULL);
for(i=0;i<3000;i++)
{ printf("\1\1\1\1\1\1\1\1\1\1\n");}
end=time(NULL);
printf("\1: The different is %6.3f\n",difftime(end,start));
}
-----------------------------------------------------------------------------
【程序93】
題目:時間函數(shù)舉例3
1.程序分析:
2.程序源代碼:
/*calculate time*/
#include "time.h"
#include "stdio.h"
main()
{ clock_t start,end;
int i;
double var;
經(jīng)典C語言程序設(shè)計(jì)100例91-100.doc下載
久久建筑網(wǎng)i5h4u.cn提供大量:建筑圖紙、施工方案、工程書籍、建筑論文、合同表格、標(biāo)準(zhǔn)規(guī)范、CAD圖紙等內(nèi)容。