设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 认证考试 >> 全国等级考试 >> 计算机等级二级C语言程序设计100例九
精品推荐
全国等级考试点击TOP10
·2007年计算机等级考试二级ACCESS大纲
·全国计算机等级考试一级MS Office考试大纲
·2007年4月计算机等级二级VF模拟笔试题五
·计算机等级考试三级数据库知识考试题
·全国计算机等级考试一级B模拟试题七
·考全国计算机等级考试三级如何学C语言
·从一级到四级 全国计算机等级考试全攻略
·全国计算机等级考试一级B模拟试题三
·2007年4月计算机三级网络技术考前模拟二
·全国计算机等级考试一级B模拟试题一
认证考试点击TOP10
·个人简历表格
·小学教师述职报告
·个人简历样本
·大学毕业生个人简历
·个人简历范文
·学生个人简历
·求职面试自我介绍一分钟
·大学生暑期三下乡社会实践报告
·Adobe Photoshop 认证试题一
·个人简历模板-标准简历(简历模板)
精选专题

计算机等级二级C语言程序设计100例九

作者: 来源:http://www.xgdown.com/ 时间:2007-3-30 7:51:57

计算机等级二级C语言程序设计100例九(1)

  【程序91】

  题目:时间函数举例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】

  题目:时间函数举例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】

  题目:时间函数举例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;i<10000;i++)
  { printf("\1\1\1\1\1\1\1\1\1\1\n");}
  end=clock();
  printf("\1: The different is %6.3f\n",(double)(end-start));
  }
  【程序94】

  题目:时间函数举例4,一个猜数游戏,判断一个人反应快慢。(版主初学时编的)

  1.程序分析:

  2.程序源代码:

以下是引用片段:
  #include "time.h"
  #include "stdlib.h"
  #include "stdio.h"
  main()
  {char c;
  clock_t start,end;
  time_t a,b;
  double var;
  int i,guess;
  srand(time(NULL));
  printf("do you want to play it.(’y’ or ’n’) \n");
  loop:
  while((c=getchar())==’y’)
  {
  i=rand()0;
  printf("\nplease input number you guess:\n");
  start=clock();
  a=time(NULL);
  scanf("%d",&guess);
  while(guess!=i)
  {if(guess>i)
  {printf("please input a little smaller.\n");
  scanf("%d",&guess);}
  else
  {printf("please input a little bigger.\n");

共6页 9 7 [1] [2] [3] [4] [5] [68 :>

计算机等级二级C语言程序设计100例九 相关文章:
计算机等级二级C语言程序设计100例九 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com