📄 printtime.c
字号:
/*--------------------------------------------------------------+| ENTROPIC PROCESSING, INC. || || This material contains proprietary software of Entropic || Processing, Inc. Any reproduction, distribution, or || publication without the the prior written permission of || Entropic Processing, Inc. is strictly prohibited. Any || public distribution of copies of this work authorized in || writing by Entropic Processing, Inc. must bear the notice || || "Copyright 1986 Entropic Processing, Inc." || |+---------------------------------------------------------------+| || print_time -- print time in a form suitable for plotas || || Shankar Narayan, EPI || Adapted by Joseph T. Buck. |+--------------------------------------------------------------*/#ifdef SCCS static char *sccs_id = "@(#)printtime.c 1.1 9/9/86 EPI";#endifprint_time (x, y)int x, y;{ long time (), tloc; char *ctime (), *tptr, tout[26]; int i; printf ("\nc 2"); printf ("\nm %d %d\nt 5 1\n", x, y); (void) time (&tloc); tptr = ctime (&tloc); for (i = 0; i < 3; i++) tout[i] = tptr[i + 8]; /* day */ for (i = 3; i < 7; i++) tout[i] = tptr[i + 1]; /* month */ for (i = 7; i < 11; i++) tout[i] = tptr[i + 13]; /* year */ for (i = 11; i < 17; i++) tout[i] = tptr[i - 1]; /* time of day */ tout[17] = '\n'; tout[18] = '\0'; printf ("%s\n", tout); printf ("\m 0 0\n");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -