#include
#include
#include
struct time
{
int hour;
int minute;
int second;
};
struct time TimeUpdate(struct time now);
int main(int argc,char const argv[])
{
int i;
struct time testtimes[5]={{23,59,59},{12,52,36},{06,12,58},{00,00,00},{25,01,26}};
for(i=0;i=0&&now.hour=60)
{
now.minute=now.minute +now.second /60;
now.second=now.second-60*(now.second/60);
if(now.minute>=60)
{
now.hour=now.hour+now.minute/60;
now.minute=now.minute-60*(now.minute/60);
}
}
printf("您输入的标准时间格式是 %02d:%02d:%02d\n",now.hour,now.minute ,now.second );
++now.second;
if(now.second ==60)
{
now.second=0;
++now.minute;
if(now.minute==60)
{
now.minute=0;
++now.hour;
if(now.hour==24)
{
now.hour =0;
}
}
}
}
else
{
printf("时间输入有误!\n");
}
} |