从键盘输入x的值 根据以下条件计算并输出x和y的值。1.x>=0 && x<2 y=x2.x>=2
已帮助 人
从键盘输入x的值,根据以下条件计算并输出x和y的值。1.x>=0 && x<2 , y=x2.x>=2 && x<6 ,y = x*x+13.x>=6 && x<10 ,y = sqrt(x+1)4.x>=10 ,y = 1/(x+1) class Program { static void Main(string[] args) { double x, y; x = Convert.ToDouble(Console.ReadLine()); if (x < 0) Console.WriteLine("Input error!"); else { switch ((int)(x / 2)) { case 0: y = x; break; case 1: case 2: y = x * x + 1; _____1______; case 3: case 4: y = Math.Sqrt(x +

回答
共1条回复-
&x break sqrt(x+1) &x break sqrt(x+1)
