C语言程序 时钟显示

来源:百度知道 编辑:UC知道 时间:2024/06/27 13:45:16
马上就要交作业拉,求大家就小弟一命吧
翻译一下下面的程序,谢谢.谢谢
#include"graphics.h"
#define PI 3.1416
#include"math.h"
#include"dos.h"
main()
{
int x0=320,y0=240,r0=150;
void init_sceen();
void sec();
init_sceen(x0,y0,r0);
sec();
closegraph();
}
void init_sceen(int x0,int y0,int r0)/********************************************/
{
int i,x,y,graphdriver,graphmode;
char s[10];
float alpha,a0=90;

graphdriver=DETECT;
initgraph(&graphdriver,&graphmode,"");
setbkcolor(3);
setcolor(2);
circle(x0,y0,r0);
circle(x0,y0,r0+30);
setfillstyle(SOLID_FILL,10);
floodfill(x0-r0-10,y0,2);
/*please input the time*/
for(i=12;i>=1;i--)
{
alpha=(a0+30*(11-i)*PI/180);
x=x0+cos(alpha)*r0-16;
y=y0-sin(alpha)*r0;
sprintf(s,"%2d",i);
setcolor(4);
settextstyle(0,0,2);

参考C语言图形函数。

while(!kbhit());
//检查当前按下的键,在没有按键的情况下,继续执行do{……} while 循环语句。

delay(msec)
//#include <system.h>,短暂延时,延时msec*4毫秒。