| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1506 人关注过本帖
标题:时钟程序---帮忙注释一下啊
取消只看楼主 加入收藏
lypylpf
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-1-3
收藏
 问题点数:0 回复次数:1 
时钟程序---帮忙注释一下啊
#include<graphics.h>
#include<math.h>
#include<dos.h>
#define PI 3.1415926
#define mid_x 320
#define mid_y 240
int main()
{ int graphdriver=DETECT,graphmode;
int end_x,end_y;
struct time curtime;
float th_hour,th_min,th_sec;
initgraph(&graphdriver,&graphmode,"C:\\TC2");
setbkcolor(BLACK);
while(!kbhit(0))
{ setcolor(GREEN);
circle(mid_x,mid_y,180);
circle(mid_x,mid_y,150);
circle(mid_x,mid_y,1);
gettime(&curtime);
th_sec=(float)curtime.ti_sec*0.1047197551;
th_min=(float)curtime.ti_min*0.1047197551+th_sec/60.0;
th_hour=(float)curtime.ti_hour*0.5235987755+th_min/12.0;
end_x=mid_x+70*sin(th_hour);
end_y=mid_y-70*cos(th_hour);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);
end_x=mid_x+110*sin(th_min);
end_y=mid_y-110*cos(th_min);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);
end_x=mid_x+140*sin(th_sec);
end_y=mid_y-140*cos(th_sec);
setcolor(RED);
line(mid_x,mid_y,end_x,end_y);
line(140,240,160,240);
line(320,60,320,80);
line(500,240,480,240);
line(320,420,320,400);
line(410,395.7,400,378.4);
line(475.7,330,458.4,320);
line(475.7,150,458.4,160);
line(410,84.3,400,101.6);
line(230,84.3,240,101.6);
line(164.3,150,181.6,160);
line(164.3,330,181.6,320);
line(230,395.7,240,378.4);
sleep(BLUE);
cleardevice();
}
closegraph();
return 0;
}

我是新手
不太懂啊

哪位高手给我注释以下啊
搜索更多相关主题的帖子: mid 时钟 注释 circle sec 
2008-01-03 10:53
lypylpf
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-1-3
收藏
得分:0 
不是我写的啊

我想学学

能注释一下吗???谢谢啊
2008-01-03 12:01
快速回复:时钟程序---帮忙注释一下啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.042477 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved