L1-004. Calculate Celsius Temperature

Given a temperature F in Fahrenheit, this problem requires writing a program to calculate the corresponding temperature C in Celsius. Calculation formula: C = 5*(F-32)/9. The question guarantees that both input and output are in the integer range.

Input format:

Input gives a temperature in Fahrenheit on one line.

Output format:

Output the corresponding integer value of Celsius temperature C in one line in the format "Celsius = C".

Input sample:
150
Sample output:
Celsius = 65

Code:

#include<stdio.h>
intmain()
{
    long long n,m;
    scanf("%lld",&n);
    m=5*(n-32)/9;
    printf("Celsius = %lld",m);
    return 0;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325284602&siteId=291194637
Recommended