题目内容
写出下列程序的输出结果.
若输入x=6,则y=________;
若输入x=18,则y=________.
答案:
练习册系列答案
相关题目
写出下列程序的运行结果.
(1)
a=input(“a=”); if a>=0 m=a*a-1; m else disp(“a negative number”) end |
(2)
x=input(“x=”); if x<=10 p=x*0.35; else p=10*0.35+(x-10)*0.7; end p |
(1)若输入-3,输出结果为______________;若输入2,输出结果为______________.
(2)若输入x=6,输出结果p=______________;若输入x=18,输出结果p=______________.