我想写个输入秒数就显示是x年x天x小时x分x秒 的程序
这个代码溢出了 谁帮我改下 谢谢 并说明在哪出错了
#include <stdio.h>
int main(void)
{
int Y; //years
long long D; //days
int days; //剩余天数
long long H; //hours
int hours; //剩余hour数
long long M; //minutes
int minutes; //剩余minute数
unsigned long long S; //seconds
int seconds; //剩余second数
printf("请输入秒数:");
scanf("%lld",&S);
M = S / 60;
H = M / 60;
D = H / 24;
Y = D / 365;
seconds % S / 60;
minutes % M / 60;
hours % H / 24;
days % D / 365;
printf("%lld seconds is %d years %d days ", S, Y, days);
printf("%d hours %d minutes %d seconds.", hours, minutes, seconds);
return 0;
}