科学网

 找回密码
  注册
搜索
查看: 812|回复: 0

不同计算机语言编程的摄氏温标、绝对温标、华氏温标转换

[复制链接]
发表于 2017-10-5 13:23:27 | 显示全部楼层 |阅读模式
http://rosettacode.org/wiki/Temperature_conversion#Python

There are quite a number of temperature scales. For this task we will concentrate on four of the perhaps best-known ones: Kelvin, Celsius, Fahrenheit, and Rankine.

The Celsius and Kelvin scales have the same magnitude, but different null points.

0 degrees Celsius corresponds to 273.15 kelvin.0 kelvin is absolute zero.

The Fahrenheit and Rankine scales also have the same magnitude, but different null points.

0 degrees Fahrenheit corresponds to 459.67 degrees Rankine.0 degrees Rankine is absolute zero.

The Celsius/Kelvin and Fahrenheit/Rankine scales have a ratio of 5 : 9.


Task

Write code that accepts a value of kelvin, converts it to values of the three other scales, and prints the result.


ExampleK  21.00C  -252.15F  -421.87R  37.80


回复

使用道具 举报

Archiver|手机版|科学网 ( 京ICP备14006957 )

GMT+8, 2017-10-18 11:52

Powered by ScienceNet.cn

Copyright © 2007-2017 中国科学报社

快速回复 返回顶部 返回列表