class Program
{
static void Main(string[] args)
{
int temp;
string choice;
int finalTemp;
Console.WriteLine("Enter a temperature");
temp = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Convert to Celsius or Fahrenheit?" + "\n" +"Enter c or f");
choice = Console.ReadLine();
if (choice == "c")
{
Celsius(temp);
}
Console.ReadLine();//to keep open
} //Main End
public int Celsius(int t)
{
int c;
c = 5 / 9 * (t - 32);
return c;
}
}
私は答えが本当に簡単であることを知っています。私が間違ったことを理解できないようです。
私は温度を摂氏法に渡そうとしています。