C语言之电子时钟程序

本文介绍如何利用C语言在Qt框架下编写一个电子时钟程序,涵盖了C语言编程基础及Qt库的使用技巧,帮助读者理解将两者结合进行桌面应用开发的方法。
摘要由CSDN通过智能技术生成

Qt 里面运行


#include<windows.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <conio.h> 
#include <time.h> 
typedef struct
{
    int x;
    int y;
}Point;
time_t now;
struct tm *pt, t1, t2;
int printpoint(Point p)
{
    Point p1;
    p1.x = p.x + 2;  p1.y = p.y + 4;
    gotoxy(p1.x, p1.y);     printf("%c%c", 2, 2);
    gotoxy(p1.x, p1.y + 1);   printf("%c%c", 2, 2);
    p1.y += 4;
    gotoxy(p1.x, p1.y);     printf("%c%c", 2, 2);
    gotoxy(p1.x, p1.y + 1);   printf("%c%c", 2, 2);
    return 0;
}
int print0(Point p)
{
    int i = 0;
    for (; i<13; i++)
    {
        gotoxy(p.x + 1, p.y + i);
        if (i == 0 || i == 12)
            printf("%c%c%c%c%c%c", 2, 2, 2, 2, 2, 2);
        else
            printf("%c%4s%c", 2, " ", 2);
    }
    return 0;
}
int print1(Point p)
{
    int i = 0;
    for (; i<13; i++)
    {
        gotoxy(p.x + 1, p.y + i);
        printf("%5s%c", " ", 2);
    }
    return 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值