编程实现:用if-else语句实现下列分段函数

完整的C语言程序
2025-02-23 01:05:36
推荐回答(2个)
回答1:

不知道你使用的什么编程语言?给你vb参考:
dim x as single,y as single
if x<1 then
y=x
elseif x>=1 then
y=3*x-11
else
y=2*x-1
end if

回答2:

if(X<1)
{y=x}
else if (x>=1){
if (x<10)
{y=2x-1}
else
{y=3x-11}
}