当前位置: > 编写程序,将输入数据的单位由mile转换到km.已知1mile等于5280foot,1foot=12in,1in=254cm,1km=100000c...
题目
编写程序,将输入数据的单位由mile转换到km.已知1mile等于5280foot,1foot=12in,1in=254cm,1km=100000c

提问时间:2020-10-25

答案
用什么语言写呢.
计算公式很简单啦:公里数 = 英里数*5280*12*2.54/100000 就可以了.
如果使用C语言:
constant int mile2foot = 5280;
constant int foot2inch = 12;
constant float inch2cent = 2.54; (should be 2.54,not 254)
constant int km2cent = 100000;
float mile,kilometer;
kilometer = mile * mile2foot * foot2inch * inch2cent / km2cent;
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.