C语言中的 outtextxy(x5, y5,s);的问题

该博客展示了如何使用C语言结合图形库实现一个电子时钟的绘制,包括绘制表盘、刻度、指针,并实时更新时间显示。通过`outtextxy()`函数在特定坐标显示数字。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

// 电子时钟.cpp: 定义控制台应用程序的入口点。
//

 

#include "stdafx.h"
#include <windows.h>
#include<graphics.h>
#include<math.h>
#include<conio.h>
#include<stdlib.h>
#define PI 3.1415926
#undef UNICODE
#undef _UNICODE
//绘制表盘
void DranDial()
{
 int x1, y1,x2,y2;
 int x3, y3, x4, y4,x5,y5;
 //创建窗口
 initgraph(600,600);
 //setbkcolor(WHITE);
 setbkcolor(RGB(248,233,209));
 cleardevice();//用设置号的颜色刷新
 //绘制圆形
 setbkcolor(BLACK);
 circle(300,300,5);
 
 circle(300, 300, 30);
 circle(300, 300, 250);
 circle(300, 300, 260);
 circle(300, 300, 270);
  char   rome[][3] = { "11", "12","1","2","3","4","5","6","7","8","9","10"};
 //int rome[12][3] = {'12','1','2','3'};
 for (int i = 0; i < 60; i++)
 {
  //画短线
  x1 = (int)(300 + (sin(PI*i/30)*250));
  y1 = (int)(300-(cos(PI*i/30)*250));
  x2 = (int)(300 + (sin(PI*i / 30) * 260));
  y2 = (int)(300 - (cos(PI*i / 30) * 260));
  line(x1,y1,x2,y2);
  if (i %
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值