[PTA] 7-7 calculated Celsius (10 minutes)

Given a Fahrenheit F., This problem requires programming, calculates the corresponding Celsius C. Calculated: C = 5 × (F-32) / 9. Title ensure that the input and the output are within the range of integers.

Input format:
Enter a given row in Fahrenheit.

Output formats:
in the format line "Celsius = C" corresponding to the integer value of the output C of the temperature in degrees Celsius.

Input Sample:
150

Output Sample:
the Celsius = 65

#include<stdio.h>
int main(void)
{
  int Celsius, fahr;
  scanf("%d", &fahr);
  Celsius=5*(fahr-32)/9;
  printf("Celsius = %d\n", Celsius);
  
  return 0;
}
Published 48 original articles · won praise 0 · Views 336

Guess you like

Origin blog.csdn.net/weixin_46399138/article/details/105331606