먼저, 화씨 온도를 설정하십시오 -
double fahrenheit = 97;
Console.WriteLine("Fahrenheit: " + fahrenheit); 이제 섭씨로 변환 -
celsius = (fahrenheit - 32) * 5 / 9;
예시
다음 코드를 실행하여 화씨를 섭씨로 변환할 수 있습니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
double celsius;
double fahrenheit = 97;
Console.WriteLine("Fahrenheit: " + fahrenheit);
celsius = (fahrenheit - 32) * 5 / 9;
Console.WriteLine("Celsius: " + celsius);
Console.ReadLine();
}
}
} 출력
Fahrenheit: 97 Celsius: 36.1111111111111