国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設計 > 正文

一個時鐘程序,可以顯示當前時間,畫的還不錯

2019-11-17 05:29:42
字體:
供稿:網(wǎng)友

  #include<graphics.h>
#include<math.h>
#include<dos.h>
#define pi 3.1415926
#define X(a,b,c) x=a*cos(b*c*pi/180-pi/2)+300;
#define Y(a,b,c) y=a*sin(b*c*pi/180-pi/2)+240;
#define d(a,b,c) X(a,b,c);Y(a,b,c);line(300,240,x,y)
void init()
{int i,l,x1,x2,y1,y2;
 setbkcolor(1);
 circle(300,240,200);
 circle(300,240,205);
 circle(300,240,5);
 for(i=0;i<60;i++)
 {if(i%5==0) l=15;
 else l=5;
 x1=200*cos(i*6*pi/180)+300;
  y1=200*sin(i*6*pi/180)+240;
   x2=(200-l)*cos(i*6*pi/180)+300;
  y2=(200-l)*sin(i*6*pi/180)+240;
  line(x1,y1,x2,y2);
  }
  }
  main()
  {
   int x,y;
   int gd=VGA,gm=2;
   unsigned char h,m,s;
   strUCt time t[1];
   initgraph(&gd,&gm,"d://tc");
   init();
   setwritemode(1);
   gettime(t);
   h=t[0].ti_hour;
   m=t[0].ti_min;
   s=t[0].ti_sec;
   setcolor(7);
   d(150,h,30);
   setcolor(14);
   d(170,m,6);
   setcolor(4);
   d(190,s,6);
   while(!kbhit())
   {while(t[0].ti_sec==s)
   gettime(t);
   sound(400);
   delay(70);
   sound(200);
   delay(30);
   nosound();
   setcolor(4);
   d(190,s,6);
   s=t[0].ti_sec;
   d(190,s,6);
   if (t[0].ti_min!=m)
   {
   setcolor(14);
   d(170,m,6);
   m=t[0].ti_min;
   d(170,m,6);
   }
   if (t[0].ti_hour!=h)
   { setcolor(7);
     d(150,h,30);
     h=t[0].ti_hour;
     d(150,h,30);
     sound(1000);
     delay(240);
     nosound();
     delay(140);
     sound(2000);
     delay(240);
     nosound();
   }
   }
   getch();
   closegraph();
   }

上一篇:一個時鐘程序

下一篇:用OLE操作Excel

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 平定县| 高邮市| 龙泉市| 苏尼特右旗| 镇沅| 嵩明县| 大厂| 乳山市| 泌阳县| 鄱阳县| 罗平县| 澳门| 神农架林区| 政和县| 邵东县| 昌邑市| 繁昌县| 延安市| 深圳市| 广安市| 垣曲县| 崇阳县| 于田县| 九江县| 长顺县| 黄陵县| 台山市| 浦县| 武乡县| 健康| 咸阳市| 景谷| 康马县| 隆子县| 二连浩特市| 凤冈县| 铁岭县| 万盛区| 甘德县| 塔河县| 龙南县|