就是因为简单,才被放倒...

来源:百度知道 编辑:UC知道 时间:2024/06/12 04:34:57
C#也算是学了几章了...竟然看到一道最简单的一题,想不出来了...不是做不出来,而是不知道语法... 不要BS我...

用户输入4个int值,算出它们的乘积...
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a, b, c, d;
Console.WriteLine("请输入四个值:");

Console.WriteLine("\n值是:{0}",a*b*c*d);
}
}
}

输入语句不知道...试了很多种
4个数..。不要用数组

是要录入几个数进去?
a=int.Parse(Console.ReadLine());
b=int.Parse(Console.ReadLine());
c=int.Parse(Console.ReadLine());
d=int.Parse(Console.ReadLine());
每录入一次,回车一下就可以了

string[] str = Console.ReadLine().Split(' ');
a=int.Parse(str[0]);
b=int.Parse(str[1]);
c=int.Parse(str[2]);
d=int.Parse(str[3]);