whats the time of next second

#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:%02un",year,++month,++day,hour,minute,second);
    system("pause");
}

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website