首页 >> 宝藏问答 >

温度转换华氏温度在线(温度转换华氏)

2024-07-30 16:00:59

问题描述:

温度转换华氏温度在线(温度转换华氏),求路过的大神指点,急!

最佳答案

推荐答案

2024-07-30 16:00:59

大家好,乐乐来为大家解答以下的问题,关于温度转换华氏温度在线,温度转换华氏这个很多人还不知道,那么今天让乐乐带着大家一起来看看吧!

1、使用VS的Windows 应用程序代码如下:using System;using system.***.generic;using ***.componentmodel;using ***.data;using ***.drawing;using ***.text;using system.***.forms;namespace WindowsApplication1{ public partial class MainForm : Form { //f=9/5*c+32,其中f为华氏温度,c为摄氏温度 double f, c = 0.00; public MainForm() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void btnH_Click(object sender, EventArgs e) { if (this.***.text == "") { this.***.focus(); ***.show("请输入温度!"); } else { try { if (((Button)sender).Name == "btnH") { f = ***.parse(this.***.text); this.***.text = "" + (f - 32) * (5.0 / 9); } if (((Button)sender).Name == "btnS") { c = ***.parse(this.***.text); this.***.text = "" + ((9.0 / 5) * c + 32); } } catch (Exception) { ***.show("请输入正确信息!"); this.***.text = ""; this.***.focus(); } } } }}。

本文分享到此完毕,希望对您有所帮助。

  免责声明:本答案或内容为用户上传,不代表本网观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。 如遇侵权请及时联系本站删除。

 
分享:
最新文章