单项选择题

有下列计算公式:若程序前面已在命令行中包含math.h文件,不能够正确计算公式的程序段是( ) A.
if(x>=0) y=sqrt(x);else y=sqrt(-x); B.
y=sqrt(x);if(x<0) y=sqrt(-x); C.
if(x>=0) y=sqrt(x);If(x<0) y=sqrt(-x); D.
y=sqrt(x>=0?x:-x);

微信扫码免费搜题