欢迎来到牛牛题库网 牛牛题库官网
logo
全部科目 > 大学试题 > 计算机科学 > 计算机程序设计 > vb考试

单项选择题

以下不能实现符号函数y=sgn(x)的程序段是()。

A.if x>0 then y=1 else if x=0 then y=0 else y= -1
B.if x>0 then y=1 else if x<0 then y= -1 else y=0
C.if x>=0 then if x=0 then y=0 else y= -1 else y=1
D.if x<>0 then if x<0 then y= -1 else y= 1 else y=0

点击查看答案
微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题