#include "stdio.h"
void main()
{struct time
{
int hour;
int min;
int sec;
};
{struct time x={10,20,30};
int m;
int s;
printf("请输入要加的分秒值");
scanf("%d,%d",&m,&s);
if(x.min+m<60)
x.min+=m;
else
{x.hour=x.hour+1;
x.min=(x.min+m)%60;
}
if(x.sec+s<60)
x.sec+=s;
else
{x.min=x.min+1;
x.sec=(x.sec+s)%60;
}
printf("增加后时间\n");
printf("hour:%d\n",x.hour);
printf("min:%d\n",x.min);
printf("sec:%d\n",x.sec);
getch();
}
}
struct time
{ int hours;
int min;
int sec;
} time;