关闭→
当前位置:中文知识站>习题库>给出一个算法:Read xIf x≤0 Thenf(x)←4xElsef(x)←2xEnd IfPrint f...

给出一个算法:Read xIf x≤0 Thenf(x)←4xElsef(x)←2xEnd IfPrint f...

中文知识站 人气:2.1W

问题详情:

给出一个算法:Read xIf x≤0 Thenf(x)←4xElsef(x)←2xEnd IfPrint f...

给出一个算法:

Read x

If x≤0 Then

f(x)←4x

Else

f(x)←2x

End If

Print f(x)

根据以上算法,可求得f(-3)+f(2)的值为________.

【回答】

 -8解析: 由题意知f(-3)=-12,f(2)=4,

f(-3)+f(2)=-12+4=-8.

知识点:算法初步

题型:填空题

TAG标签:#read #4xElsefx #xIf #Thenfx #2xEnd #
猜你喜欢