现在已经尝试了 4 个多小时,我一点也不专业,我绝对需要帮助。知道出了什么问题吗?
// Declare variables
int inches = 0;
double centimetres = 0;
string input;
//Ask for input
Console.Write("Enter Number of centimetres to be converted: ");
input = Console.ReadLine();
//Convert string to int
centimetres = double.Parse(input);
inches = int.Parse(input);
inches = int.Parse(centimetres / 2.54);
//Output result
Console.WriteLine("Inches = " + inches + "inches.");
}
}