#include <stdio.h>
int main()
{
long i = 0;
long Day =0,Hour = 0,Minute = 0,Second =0;
printf("请您输入1个秒数:\n");
scanf("%ld",&i);
Day = i/86400%30; //计算天数
Hour = i/3600%24; //计算小时数
Minute = i/60%60; //计算分钟数
Second = i%60; //计算秒数
printf("您好,您输入的秒数是%ld天%ld小时%ld分钟%ld秒\n",Day,Hour,Minute,Second);
return 0; |
|