关于时间换算的程序,小白求解(-__-)b
#include <stdio.h>#include <windows.h>
#define SECS_PER_MIN 60
#define SECS_PER_HOUR 3600
#define SECS_PER_DAY 86400
int seconds1, seconds, minutes, hours, days, seconds_left, minutes_left, hours_left;
int main(void)
{
printf("Please enter the number of seconds:");
scanf("%u",seconds1);
days = seconds1 / SECS_PER_DAY;
seconds_left = seconds1 % SECS_PER_DAY;
hours = seconds_left / SECS_PER_HOUR;
hours_left = seconds_left % SECS_PER_HOUR;
minutes = hours_left / SECS_PER_MIN;
seconds = hours_left % SECS_PER_MIN;
printf("The result is %u days, %u hours, %u minutes, %u seconds",days, hours, minutes, seconds);
system("pause");
return 0;
}
就是上面这个东西……写了半天结果运行程序时输什么值都报错……(-__-)b
这个怎么办咧?