printtime.c

来自「speech signal process tools」· C语言 代码 · 共 48 行

C
48
字号
/*--------------------------------------------------------------+| 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 + =
减小字号Ctrl + -
显示快捷键?