初学者的问题。谢谢解答
输入4个INT值。显示乘积。我用了Convert.ToInt32。但为什么我输入带小数点类型的会出现 输入字符串的格式不正确的提示 。另外想问下int.Parse和 Convert.ToInt32有什么区别。网上有点看不懂。。谢谢static void Main(string[] args)
{
int first, second, third, four;
Console.WriteLine("please shu ru 4 ge shu:");
first =Convert.ToInt32(Console.ReadLine());
second = Convert.ToInt32(Console.ReadLine());
third = Convert.ToInt32(Console.ReadLine());
four = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("the four number cheng ji is {0}.", first * second * third * four);
Console.ReadKey();
}