又有问题了~~帮忙
#include "stdio.h"struct time
{
int hour;
int minutes;
int seconds;
};
int main( void )
{
struct time timeupdate ( struct time now );
struct currenttime,nexttime;
printf ("enter the time ( hh: mm: ss )");
scanf ("%i:%i:%i", ¤ttime.hour, ¤ttime.minutes, ¤ttime.seconds );
nexttime = timeupdate (currenttime);
printf ("updated time is %.2i:%.2i:%.2i\n",nexttime.hour, nexttime.minutes, nexttime.seconds);
return 0;
}
struct time timeupdate ( struct time now )
{
++now.seconds;
if ( seconds == 60 ) {
now.seconds = 0;
++now.minutes;
if ( minutes == 60) {
now.minutes = 0;
++now.hour;
if ( now.hour == 24 ) {
now.hour = 0;
}
}
return now;
}