1115:0 start-up algorithm 22--Fahrenheit Celsius temperature conversion

Source: Internet
Author: User

1115:0 starting point algorithm 22--Fahrenheit Celsius temperature conversion time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:3522 accepted:1456
[Submit] [Status] [Web Board] Description

Enter a temperature of Fahrenheit and calculate the corresponding Celsius temperature according to the formula C= (5/9) (F-32).

Input

Enter a temperature value of Fahrenheit (multiple sets of data)

Output

The output input Fahrenheit temperature and the converted Celsius temperature value.

Input format please refer to sample (one row per group of data)

Sample Input
100

Sample Output
fahr=100.000000,celsius=37.777779

HINT

All data in the calculation use float type Note the notation of the float constant

Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     floatf,c;4      while(SCANF ("%f", &f)! =EOF) {5C=5.0/9* (f +);6printf"fahr=%f,celsius=%f\n", f,c);7     }8     return 0;9}

1115:0 start-up algorithm 22--Fahrenheit Celsius temperature conversion

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.