输出当前的时间的下一秒 C 语言实现!
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
enum DateType
{
YEAR,
MONTH,
DAY,
HOUR,
MINUTE,
SEC,
MAX,
};
#define DUMMY 0
const char *g_apcCnName[MAX]={"年","月","日","时","分","秒"};
int isLeapYear(int iYear)
{
return ((iYear%4==0&&iYear%100!=0)||iYear%400==0);
}
int main()
{
int i;
int aiTime[MAX]={0};
int aiTimeMaxValue[MAX]={9999,12,31,23,59,59};
int aiTimeMinValue[MAX]={1970,1,1,0,0,0,};
int aiMonthMaxDay[]={DUMMY,31,28,31,30,31,30,31,31,30,31,30,31};
for(i=YEAR;i<MAX;++i)
{
printf("请输入%s",g_apcCnName[i]);
scanf("%d",aiTime+i);
if(MONTH==i&&isLeapYear(aiTime[YEAR]))
{
aiMonthMaxDay[2]=29;
}
if(DAY&#