输入到要加的小时时就报错
想做一个计算时间的计算器
```c
#define _CRT_SECURE_NO_WARNINGS
#include
int main()
{
int xs, cs, cf, xf, js, jf, t;
t = 0; xs = 0; cs = 0; cf = 0; xf = 0; js = 0; jf = 0;
printf("现在的小时\n");
scanf("%d", &xs);
printf("请输入现在的分钟\n");
scanf("%d", &xf);
printf("请输入要加的小时\n");
scanf("%d", js);
printf("请输入要加的分钟\n");
scanf("%d", &jf);
cs = xs + js;
cf = xf + xs;
while (cs < 24 && cf < 60)
{
if (cs > 24)
{
t += 1;
cs = cs - 24;
}
if (cf > 60)
{
cs += 1;
cf -= 60;
}
}
printf("第%d天%d点%d分", t, cs, cf);
return 0;
}
```
小时 scanf 那漏了个&
printf("请输入要加的小时\n");
scanf("%d", &js);