题目内容
根据以下函数关系,对输入的每个x值,计算出相应的y值。main(){ int x, c, m;float y;scanf ("%d ", &x);if () c = - 1;else c = ;switch (c){ case –1 : y = 0; break;case 0: y = x; break;case 1: y = 10; break;case 2:case 3: y = -0.5 * x + 20; break;default : y = -2;/*y=-2表示输入非法*/}if ()printf ("y = %f ", y);else printf ("error \n ");}
查看答案
搜索结果不匹配?点我反馈