提问:用switch语句编程实现下列函数关系,请填空
用switch语句编程实现下列函数关系,请填空。当x<0y=-1当x=0y=0当x>0y=1#include<stdio.h>intmain(){intx,y;【31】;switch(x<0){case1:【32】;break;case0:switch(【33】){case1:y=0;【34】;【35】:y=1;}printf(“输入x的值为%d,对应y值为%f。”,x,y);}
网友回答:
完整的程序及填空参考:
提问:用switch语句编程实现下列函数关系,请填空
用switch语句编程实现下列函数关系,请填空。当x<0y=-1当x=0y=0当x>0y=1#include<stdio.h>intmain(){intx,y;【31】;switch(x<0){case1:【32】;break;case0:switch(【33】){case1:y=0;【34】;【35】:y=1;}printf(“输入x的值为%d,对应y值为%f。”,x,y);}
网友回答:
完整的程序及填空参考: