编写一段程序,要求输入x的值,输出y的值,分别用不嵌套if语句,嵌套语句,if else语句,switch语句,编写

日期:2013-02-04 22:35:32 人气:1

编写一段程序,要求输入x的值,输出y的值,分别用不嵌套if语句,嵌套语句,if else语句,switch语句,编写

#include float f1(float x){ //不用嵌套if float t; if(-5<x && x<0) t=x; if(x==0) t=x-1; if(0<x && x<10) t=x+1; return t; } float f2(float x){ //嵌套if float t; if (-5<x && x<10){ t=x+1; if(-5<x && x&l
    A+
热门评论