Console.Write("Please type in the first floating point number: ");
double floating_1 = Convert.ToDouble(Console.ReadLine());
Console.Write("Please type in the second floating point number: ");
double floating_2 = Convert.ToDouble(Console.ReadLine());
double product = floating_1 * floating_2;
double difference = floating_1 - floating_2;
double sum = floating_1 + floating_2;
Console.WriteLine("The product of the two floating point numbers is: " + product + "\nThe sum of the two floating point numbers is: " + sum + "\nThe difference between the two floating point numbers is: " + difference);
Console.ReadLine();
我有这段代码。每当我执行程序时,小数点显示不正确(如数字:45.23 将显示为 4523)。