
请问一下我在哪里出问题了(刚刚接触编程的菜🐔)
判断要用==符号
例如这些地方都需要改正
elseif((b<59)&&(c==59))
可运行的例子:
#include <stdio.h>
struct myTime
{
int h;
int m;
int s;
};
int main()
{
struct myTime T;
int h,m,s;
scanf("%d:%d:%d",&h,&m,&s);
T.h=h;
T.m=m;
T.s=s;
if (s==59)
{
T.s=0;
T.m++;
if (T.m==60)
{
T.m=0;
T.h++;
if (T.h==24)
{
T.h=0;
}
}
}
else
{
T.s++;
}
printf("%02d:%02d:%02d\n",T.h,T.m,T.s);
return 0;
}
