惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
美团技术团队
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
博客园_首页
雷峰网
雷峰网
V
V2EX
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
量子位
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Jina AI
Jina AI
月光博客
月光博客
L
LangChain Blog

博客园 - Aween's Blog

showModelessDialog()使用详解 通用数制转换器 图形旋转的C语言源程序 字符串查找 c语言库函数 学习c语言程序设计的误区 图形处理 基本调试手段 图形程序运行的条件 关于二十四点游戏的编程思路 飞行字 以前常用的攻击软件源代码 图形模式下的汉字显示 两个矩阵相乘的源程序 运行错误的判断与调试 五子棋算法 设计彩色框的c源程序 上海黑暗之龙--麻将原代码 董乘宇--迷宫程序1.10版
全屏幕模拟时钟的c源程序
Aween's Blog · 2006-03-02 · via 博客园 - Aween's Blog

 #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();
}