大一上学期为了找了一个学期的对象,结果对象没找到,学业也荒废了。。。。。。
把期末没考虑出来的题目现在发一下,这是一个很简单的结构体
#include <stdio.h>
#include <stdlib.h>
struct time
{
int hh; // 时
int mm; // 分
int ss; //秒
}time;
struct time to_time(int n)
{
time.hh=n/3600;
time.mm=(n%3600)/60;
time.ss=(n%3600)%60;
};
int put_time(struct time t)
{
printf("%02d:%02d:%02d\n",time.hh,time.mm,time.ss);
}
int main()
{
int n;
struct time tm;
while(scanf("%d", &n) != EOF)
{
tm = to_time(n);
put_time(tm);
}
return 0;
}