样例:一、设计题目:(宋体五号加黑)有滴答声音的全屏模拟时钟.(宋体五号)二、题目阐述及设计思路:这
答案:2 悬赏:10 手机版
解决时间 2021-01-26 18:08
- 提问者网友:留有余香
- 2021-01-26 14:36
样例:一、设计题目:(宋体五号加黑)有滴答声音的全屏模拟时钟.(宋体五号)二、题目阐述及设计思路:这
最佳答案
- 五星知识达人网友:爱难随人意
- 2021-01-26 16:06
#include stdio.h#include math.h#include dos.h#include graphics.h#define PI 3.1415926#define th PI/180#define a 60void DrawXin(int x0,int y0,int k) ;void main(){ int gr=DETECT,gm; float th_hour,th_min,th_sec,end_x,end_y; struct time now; initgraph(&gr,&gm,c:\\turboc2); cleardevice(); DrawXin(320,200,90); while (!kbhit()) { setcolor(YELLOW); gettime(&now); th_sec=( 90-(float)now.ti_sec*6 )*th ; th_min=(90-( (float)now.ti_min+(float)now.ti_sec/60.0 )*6 )*th; th_hour=(90-( (float)now.ti_hour+(float)now.ti_min/60.0+(float)now.ti_sec/3600.0)*12)*th; end_x=320+cos(th_sec)*120; end_y=240-sin(th_sec)*120; line(320,240,end_x,end_y); end_x=320+cos(th_min)*90; end_y=240-sin(th_min)*90; line(320,240,end_x,end_y); end_x=320+cos(th_hour)*60; end_y=240-sin(th_hour)*60; line(320,240,end_x,end_y); sleep(1); setcolor(RED); end_x=320+cos(th_sec)*120; end_y=240-sin(th_sec)*120; line(320,240,end_x,end_y); end_x=320+cos(th_min)*90; end_y=240-sin(th_min)*90; line(320,240,end_x,end_y); end_x=320+cos(th_hour)*60; end_y=240-sin(th
全部回答
- 1楼网友:妄饮晩冬酒
- 2021-01-26 17:39
我学会了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯