| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 287 人关注过本帖
标题:请帮我看看这段代码。能运行,但是闪屏是怎么回事?
取消只看楼主 加入收藏
萌77
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-12-23
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
请帮我看看这段代码。能运行,但是闪屏是怎么回事?
#include<graphics.h>
#include<math.h>
#include <dos.h>
#include <stdio.h>
#include <time.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_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);  
gotoxy(28,20);
 {time_t timep;
  time (&timep);
        printf("%s", ctime(&timep));
 }
cleardevice();
}
closegraph();
return 0;
}
搜索更多相关主题的帖子: include 
2013-12-23 09:35
快速回复:请帮我看看这段代码。能运行,但是闪屏是怎么回事?
数据加载中...
 
   



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

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