编程 用Turbo C 编时钟

来源:百度知道 编辑:UC知道 时间:2024/06/21 09:22:24
首先自定义一个函数DrawClock()画出时钟的表盘,再由gettime(&newtime)检测系统时间,每秒钟调用DrawClock()更新一次表盘,用户按任意键退出图形方式,程序结束。
时钟表盘和时针、分针、秒针的绘制5分,动画10分

最好一些关键程序有说明一下 谢谢

Turbo C 八角形指针式罗马表

#include <dos.h>
#include <math.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>

void drawhourbrick(int x, int y, int color, float arg);
void drawminutebrick(int x, int y, int color, float arg);
void drawsecondbrick(int x, int y, int color, float arg);
void polygon(int n, int x, int y, int r, int color, float arg, int fillstyle);

int main()
{
int GraphDriver;
int GraphMode;
float arg = 292.5;
float hourarg = 0;
float minuterarg = 0;
float secondrarg = 0;
char buffer[10];
int a, b;
int x, y, r;
int h;
int xmo[12] = {1, 2, -6, -1, -1, -2, -2, -1, 0, -4, -4, -5};
int ymo[12] = {-1, -2, -1, -1, -1, -5, 2, 1, -2, -4, -4, 0};
long delay;
float degree;
struct time time, time1;
GraphDriver = DETECT;
initgraph(&GraphDriver, &GraphMode, "&qu