首页 相关文章 一个简单易懂的时钟程序

一个简单易懂的时钟程序

/***********简单的时钟程序,界面不是很美观,您可以根据自己的爱好加以修改,如给表盘加上刻度,将指针改为其它外形等*/#includegraphics.h
  #includemath.h
  #includedos.h#define PI 3.1415926
  #define x0 320 /*定义钟表中心坐标*/
  #define y0 240void DrawClock(int x,int y,int color) /*画表盘*/
  { int r=150; /*表盘的半径*/
   float th;
   setcolor(color);
   circle(x,y,r);
   circle(x,y,2);
  }void DrawHand(int x,int y,float th,int l,int color)
  {
   int x1,y1;
   x1=x+l*sin(th);
   y1=y-l*cos(th);
   setcolor(color);
   line(x,y,x1,y1);
  } void...[ 查看全文 ]

2016-02-19 标签:

一个简单易懂的时钟程序的相关文章

手机页面
收藏网站 回到头部