立即注册 登录
长春网 返回首页

qxslp8683的个人空间 http://www.cczcc.com/space-uid-8630.html [收藏] [复制] [分享] [RSS]

日志

跪求!!!谁会写vb课程设计数字时钟的源代码? BAUMER

已有 190 次阅读2014-12-29 03:53

BAUMER跪求!!!谁会写vb课程设计数字时钟的源代码? #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=DETECT,gm=2; unsigned char h,m,s; struct time t[1]; initgraph(&gd,&gm,"");/*此处要根据自己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(); } 记得要加分的

BAUMER


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

关于我们|手机版|简洁版|搜索|广告招商|长春网

GMT+8, 2024-7-7 21:38 , Processed in 0.040174 second(s), 15 queries .

版权所有 吉林省新格信息技术有限公司 长春网 联系QQ:5053050 微信号:13624467185

© 2008-2012 吉林省长春地区信息分享门户网站。 ICP备案号: 皖ICP备2021004516号-11
建站技术支持:长春新格

回顶部