3、编程实现:给定一段时间求出它的秒数。(如计算2小时 17分30秒等于多少秒)
最佳答案
你要用什么语言,这个简单的可用C实现
#include<stdio.h>
int main()
{
int h,m,s;
scanf("%d%d%d",&h,&m,&s); //输入时分秒,以空格隔开
s+=m*60+h*3600; //转化为秒
printf("%d\n",s);
return 0;
}
最佳答案由网友 whoami1978 提供
其他回答
暂无其它回答!
你要用什么语言,这个简单的可用C实现
#include<stdio.h>
int main()
{
int h,m,s;
scanf("%d%d%d",&h,&m,&s); //输入时分秒,以空格隔开
s+=m*60+h*3600; //转化为秒
printf("%d\n",s);
return 0;
}
暂无其它回答!