What will be the values of ans, x, and y after the following statements are executed? int ans = 35, x = 50, y =50; if ( x >= y) { ans = x + 10; x -=y; } else { ans = y + 10; y += x; }
举一反三
- What will be the values of ans, x, and y after the following statements are executed?执行以下语句后,ans,x和y的值是什么?int ans = 35, x = 50, y =50;if ( x >;= y){ans = x + 10;x -=y;} else {ans = y + 10;y += x;} A: ans = 60, x = 50, y =100 B: ans = 60, x =0, y =50 C: ans = 45, x = 50, y = 0 D: ans = 45, x = 50, y = 50
- What will be the value of ans after the following code has been executed? int x = 90, y = 55, ans = 10; if ( x == y); ans *= 2;
- What will be the value of ans after the following code has been executed?执行以下代码后,ans的值是什么?int x = 90,y = 55,ans = 10;if ( x == y);ans *= 2; A: 10 B: 145 C: 20 D: No value, there is a syntax error 无值,语法错误
- 求微分方程[img=101x35]17da5f15503f795.png[/img] 的通解,实验命令为(). A: dsolve(Dy+2*x*y=x*exp(-x^2))ans=C1*exp(-x^2) + (x^2*exp(-x^2))/2 B: dsolve('Dy+2*x*y=x*exp(-x^2)','x')ans=C1*exp(-x^2) + (x^2*exp(-x^2))/2 C: dsolve('Dy+2*x*y=x*exp(-x^2)')ans=C1*exp(-x^2) + (x^2*exp(-x^2))/2
- 【单选题】针对下列分段函数: 下列哪个程序段存在逻辑错误 。 A. if(x<0) y=x+1; if(x>=0 && x<10) y=x*x-5; if(x>=10) y=x*x*x; B. if(x<0) y=x+1; else if(x<10) y=x*x-5; else y=x*x*x; C. if(x<10) y=x*x-5; else if(x<0) y=x+1; else y=x*x*x; D. if(x<0) y=x+1; else if(x>=10) y=x*x*x; else y=x*x-5;