问题
填空题
给出一个算法:
Input x
If x≤0 then
f(x)=4x
Else
f(x)=2x
End if
Print f(x)
End
根据以上算法,可求得f(-3)+f(2)的值为______.
答案
f(x)=4x x≤0 2x x>0
f(-3)+f(2)=4×(-3)+4=-8
故答案为:-8
给出一个算法:
Input x
If x≤0 then
f(x)=4x
Else
f(x)=2x
End if
Print f(x)
End
根据以上算法,可求得f(-3)+f(2)的值为______.
f(x)=4x x≤0 2x x>0
f(-3)+f(2)=4×(-3)+4=-8
故答案为:-8