[C#] C#华氏温度和摄氏温度的相互专函代码片段 →→→→→进入此内容的聊天室

来自 , 2020-10-04, 写在 C#, 查看 135 次.
URL http://www.code666.cn/view/d3e0f226
  1. public static double CelsiusToFahrenheit
  2.    (string temperatureCelsius)
  3. {
  4.    double celsius = System.Double.Parse (temperatureCelsius);
  5.    return (celsius * 9 / 5) + 32;
  6. }
  7.  
  8. public static double FahrenheitToCelsius
  9.    (string temperatureFahrenheit)
  10. {
  11.    double fahrenheit = System.Double.Parse (temperatureFahrenheit);
  12.    return (fahrenheit - 32) * 5 / 9;
  13. }
  14. //csharp/4148

回复 "C#华氏温度和摄氏温度的相互专函代码片段"

这儿你可以回复上面这条便签

captcha