题目内容
画出程序框图并编写程序,对于函数y=x2,x≤0,
输入一个x的值,输出相应y的值.
解:程序框图
![]()
程序:
Input x
If x<=0 then
y=x*x
Print y
Else
If x>=1 then
y=x+1
Print y
Else
Print “输入有误!”
End if
End if
End
练习册系列答案
相关题目
题目内容
画出程序框图并编写程序,对于函数y=x2,x≤0,
输入一个x的值,输出相应y的值.
解:程序框图
![]()
程序:
Input x
If x<=0 then
y=x*x
Print y
Else
If x>=1 then
y=x+1
Print y
Else
Print “输入有误!”
End if
End if
End