吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3631|回复: 3
收起左侧

[C&C++ 转载] 用c语言写一个类型考勤的工具

  [复制链接]
lcx4 发表于 2015-5-4 14:23
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <time.h>

int main(void)
{
        struct mytime
        {
                //char name[256];
                int hour;//时
                int min; //分
                int sec; //秒
        };

        struct stu_data
        {
                char name[256];//学生名字
                struct mytime stuTime;//签到时间
        };

        struct stu_data stu[50];
        time_t t;// long int
        struct tm * timfo;
        int i;

        for (i = 0; i < 3; i++)
        {
                scanf("%s", &stu[i].name);
                time(&t);
                timfo = localtime(&t); //取当前系统时间
                stu[i].stuTime.hour = timfo->tm_hour;//时
                stu[i].stuTime.min = timfo->tm_min;//分
                stu[i].stuTime.sec = timfo->tm_sec;//秒
                printf("%s,到校时间:%d时%d分%d秒\n", stu[i].name, stu[i].stuTime.hour, stu[i].stuTime.min, stu[i].stuTime.sec);
        }

        system("pause");
        return 0;
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

waxtmd 发表于 2015-5-4 14:48
学习一下
头像被屏蔽
LOLO 发表于 2015-5-4 15:19
ぁмǐηɡ玥夜 发表于 2015-10-3 18:05
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-23 01:33

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表