C语言编写一个程序,把560分钟换算成用小时和分钟表示,然后输出知道
1个回答
展开全部
//C语言编写一个程序,把560分钟换算成用小时和分钟表示,然后输出
/*
compile:
gcc
test.c
-otest
run:
./test
560
*/
#include
<stdio.h>
int
main(int
argc,
char
**
argv)
{
int
nNum
=
atoi(argv[1]);
int
nHour
=
0;
int
nMin
=
0;
char
acTime[12]
=
{0};
nHour
=
nNum/60;
nMin
=
nNum%60;
sprintf(acTime,
"%02d:%02d:%02d",
nHour,
nMin,
0);
printf("%d
Minute
qauls
to:%s\n",
nNum,
acTime);
return
0;
}
/*
compile:
gcc
test.c
-otest
run:
./test
560
*/
#include
<stdio.h>
int
main(int
argc,
char
**
argv)
{
int
nNum
=
atoi(argv[1]);
int
nHour
=
0;
int
nMin
=
0;
char
acTime[12]
=
{0};
nHour
=
nNum/60;
nMin
=
nNum%60;
sprintf(acTime,
"%02d:%02d:%02d",
nHour,
nMin,
0);
printf("%d
Minute
qauls
to:%s\n",
nNum,
acTime);
return
0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询