📄 nicetime.c
字号:
/*
nicetime.c
for Free Chat
by Bill Kendrick
kendrick@zippy.sonoma.edu
http://zippy.sonoma.edu/kendrick/
June 10, 1997
*/
#include <stdio.h>
#include <string.h>
#include "nicetime.h"
char * nicetime(char * time)
{
int hour;
char better[16];
strcpy(better, time);
if (time[0] == '2' || (time[0] == '1' && time[1] >= '2'))
{
strcpy(better, time);
hour = (time[0] - '0') * 10 + (time[1] - '0');
if (hour > 12)
hour = hour - 12;
better[0] = (hour / 10) + '0';
better[1] = hour - (hour / 10) * 10 + '0';
strcat(better, "p");
}
else
strcat(better, "a");
return(strdup(better));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -