作者在 2014-06-04 21:51:49 发布以下内容
#include<stdio.h>
#include<Windows.h>
int main()
{
unsigned int year,month,day,hour,minute,second;
unsigned int dom[]={31,28,31,30,31,30,31,31,30,31,30,31};
scanf("%u %u %u %u %u %u",&year,&month,&day,&hour,&minute,&second);
if(year%400==0||(year%4==0&&year%100!=0)) dom[1]=29;
day--,month--;
if(!(++second%=60)&&!(++minute%=60)&&!(++hour%=24)&&!(++day%=dom[month])&&!(++month%=12)) year++;
printf("%04u-%02u-%02u %02u:%02u:%02u\n",year,++month,++day,hour,minute,second);
system("pause");
}