正在加载图片...
214i语句的嵌套 例2-5:编程求解分段函数: 1x<0 方法3 y 0x=0 if(x>=0) 1x>0 方法1 if(x>0)y=1; if (X<0) else y=0 else if(x==0)y=0; else y=-1: else y=l 方法4 方法2 y=-1; if(x==0)y=0: if(x!=0 else if(X<0)y=-1; if(x>0)y=1;} else y=l else y=0例2-5: 编程求解分段函数: -1 x<0 0 x=0 1 x>0 y = 方法1 if (x<0) y=-1; else if (x==0) y=0; else y=1; 方法3 if (x>=0) if (x>0) y=1; else y=0; else y=-1; 方法4 y=-1; if (x!=0) { if(x>0) y=1; } else y=0; 方法2 if (x==0) y=0; else if (x<0) y=-1; else y=1; 2.1.4 if语句的嵌套
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有