为抵抗洪水, 战士连续作战89小时, 编程计算共多少天零多少小时?
作者:互联网
<script>
var totalHours = 89;
var day = parseInt(totalHours / 24);
var hour = totalHours % 24;
document.write("共需" + day + "天" + hour + "小时<br>"); */
//提示:摄氏度与华氏度的转换公式为:摄氏度 = 5/9.0*(华氏度-32)保留3位小数
var hs = 80;
var ss = (5 / 9.0) * (hs - 32);
//ss = parseInt(ss * 1000) / 1000;
ss = ss.toFixed(3);
document.write("摄氏度为:" + ss);
</script>
标签:totalHours,ss,hs,华氏度,摄氏度,天零,89,var,小时 来源: https://blog.csdn.net/BUG_Jia/article/details/119277985