c语言问题24

来源:百度知道 编辑:UC知道 时间:2024/07/06 21:47:47
编写打印系统当前日期时间的程序

本题的一个完整的c程序如下,在win-tc和Dev-c++下都调试通过。
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
# include <stddef.h>

main()
{
struct tm *p;
time_t l;
l=time(NULL);
p=localtime(&l);
printf(asctime(p));
getch();
}