【程序93】
题目:时间函数举例3
1。程序分析:
2。程序源代码:
/*calculate time*/
#include 〃time。h〃
#include 〃stdio。h〃
main()
{ clock_t start;end;
int i;
double var;
start=clock();
for(i=0;ii)
{printf(〃please input a little smaller。n〃);
scanf(〃%d〃;&guess);}
else
{printf(〃please input a little bigger。n〃);
scanf(〃%d〃;&guess);}
}
end=clock();
b=time(NULL);
printf(〃1: It took you %6。3f secondsn〃;var=(double)(end…start)/18。2);
printf(〃1: it took you %6。3f secondsnn〃;difftime(b;a));
if(var
小提示:按 回车 [Enter] 键 返回书目,按 ← 键 返回上一页, 按 → 键 进入下一页。
赞一下
添加书签加入书架