Alibabacloud.com offers a wide variety of articles about celsius to fahrenheit formula, easily find your celsius to fahrenheit formula information here online.
//Fahrenheit temperature and Celsius temperature conversion, write a program to convert Fahrenheit temperature to Celsius temperature or Celsius temperature conversion Chenghua temperature.When the program is run, the temperature value and unit are read from the console, and
limit fi17 18 # sed-e's/unit in the original book [-[: digit:] * // g, after testing, I modified the temp in the 19 # sed-e's/[^-[[: digit:] * // g' original book, same as 20 unit = "$ (echo $1 | sed-e's/[[: digit:] * // g' | tr '[: lower:] ''[: upper:] ')" # obtain the Letter 21 temp = "$ (echo $1 | sed -E's/[^ [: digit:] * // g') "# obtain the number 22, 23, case $ {unit: = F} in # set the default variable value in 24 F) # formula for converting
1 defWD ():2W=input ('Please enter a Celsius temperature or a Fahrenheit temperature, e.g., 34c/c or 34f/f:')3 ifW[-1]inch['C','C']:4W=float (w[:-1])5Hs=1.8*w+326 Print('Fahrenheit temperature: {:. 2f}f'. Format (HS))7 elifW[-1] in ['F','F']:8W=float (w[:-1])9ss= (W-32)/1.8Ten Print('Celsius tem
1115:0 starting point algorithm 22--Fahrenheit Celsius temperature conversion time
limit:1 Sec Memory limit:64 MB 64bit IO Format:%lldsubmitted:3522 accepted:1456[Submit] [Status] [Web Board]
DescriptionEnter a temperature of Fahrenheit and calculate the corresponding Celsius temperature according to the
Use the formula ℃= (5/9) (°F-32) to convert Celsius temperature to Fahrenheit.The implementation is as follows:#include void Main (){float F,c;printf ("Please enter Fahrenheit temperature:");scanf ("%f", f);c=5* (f-32.0)/9.0;printf ("Celsius Temperature:%5.2f\n", c);}This article is from the "vs LV" blog, so be sure to
Transformation
private void Buttonctof_click (object sender, System.EventArgs e){Double c=0,f;try//the input error with the thrown exception to replace the regular.{c=convert.todouble (textBox1.Text.ToString ());} Convert conversion function, easy to usecatch (Exception){Textbox1.clear ();Label2. text= "Please enter a number!" ";Label2. Visible=true;return;//must have returned, otherwise the following code will still be executed};f=1.8*c+32;//Celsius
This article describes the C language printing Fahrenheit-Celsius temperature comparison table method. Share to everyone for your reference. The implementation methods are as follows:
* * Print Fahrenheit-Celsius temperature comparison/
#include
I hope this article will help you with the C language program.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.