第一步,设置报警阈值为37度;
第二步,获取人的体温;
第三步,获取的人的体温与报警阈值作比较,如果体温不超过报警阈值,则显示“正常通行”;否则显示“体温高报警”。
图1
A.
B.
C.
D.
f=37
t= ("请输入检测的体温:")
t=eval(t)
if t<f
print("正常体温")
:
print("体温高报警")
wine_ value=int (input ("请输入酒精含量:") )
if wine. _value<20:
print ("不构成酒驾")
else:
if 80>wine_ value>=20:
print ("构成酒驾")
else:
print ("构成醉驾")
year=2021 if (year%400==0) or ( year%4==0 and year%100!=0 ): days=366 else: days=365 print(days) ⑴程序运行结果是:。 |
a=88 b=48 c=a//b If c==0: c=a*10+b . elif 1<=c<=9: c=a*100+b elif 10<=c<=99: c=a*1000+b print(c) ⑵程序运行结果是:。 |
for i in range(1,10,2): print(iend=" ") ⑶程序段执行结果是:。 |
for i in range(1,100): if i%3==0 and i%7==0: print(iend=" ") ⑷程序段执行的结果是:。 |
d=
if d>0 then
x1= (-b + Sqr(d)) / (2 * a)
x2=
text4.text=str(x1)
text5.text=str(x2)
label6.caption=“有两个不同的实数根”
else
if then
x1=(-b)/(2*a)
x2=x1
text4.text=str(x1)
text5.text=str(x2)
label6.caption=“有两个相同的实数根”
else
text4.text=
text5.text=""
label6.caption=
end if
end if
Dim i As Integer, s As Integer
s=4
i=9
If i < 1 Then
i=i-3
Else
i=s+i
End If
s=1
For i=1 to 3
s=s*i
Next i
x=5
y=-6
If Not x>0 Then x=y-3 Else y=x+3
Print x-y; y-x
商品折扣表:
商品名称 |
原价 |
折扣力度 |
篮球鞋001 |
488元 |
4折 |
篮球鞋002 |
458元 |
5折 |
跑步鞋001 |
398元 |
5折 |
跑步鞋002 |
358元 |
6折 |
徒步鞋001 |
339元 |
6折 |
软件设计要求:(如图)
①新建一个VB工程,完成“折扣商品计算器”程序的设计。将工程文件以sale.vbp、窗体文件以sale.frm保存到考试目录“操作题”下;
②窗体的标题为“折扣商品计算器”;窗体的左边有三个标签,Label1的属性为“商品原价a:”、Label2的属性为“折扣力度b:”、 Label3的属性为“折后价格c:”;它们的旁边分别有三个文本框,Text1用于商品原价、Text2用于输入折扣力度、Text3用于输出折后价格;在文本框的右边有三个标签,Label4的属性为“元”、Label5的属性为“折”、 Label6的属性为“元”;
③单击“计算”按钮(Command1),根据计算公式将相应的提示信息显示在标签Text3中;
计算公式为:折后价格=商品原价*折扣力度;如果折后价格不高于200元,MsgBox函数提示“可以购买!”;如果折后价格高于200元,MsgBox函数提示“对不起!买不起,请您放弃!”。请编程实现。
④结论:最适合小明的运动鞋是什么。请填写商品名称
if int (input ( ) ) %5= =0:
print("yes")
if int (input ( ) ) %5!=0:
print("no")
如果输入7,则输出( )。
a=10, i=10
If i>10 then
a=a+i
Else
a=a-i
End if
m= 1 m = m+ 5 n = 5 + m Print n ,m |
a = 2 b = 3 print a > b |
a=10 b=20 If a>b then Print a, b Else Print b, a End if |
For k=15 to 1 step -5 Print k; next |
图1
Private Sub Command1_Click( )
w= val (Text1. text)
if then
f=38
Else
f=
End If
Text2. text=f
End Sub
x=20
if x>=100 then y=5*x else y=4*x
end if
a=int(input( ))
if a>0:
print("正整数")
elif a<0:
print("负整数")
else:
print("零")
负整数
零
B . 正整数 C . 负整数 D . 零m=int(input("请输入一个整数:"))
if ⑴:
print("这个数字是奇数")
⑵:
print("这个数字是偶数")
⑴A.m/2=0 B.m//2==0 C.m%2=0 D.m%2==1
⑵A.if B.else C.elif D.break
1)系统随机生成一个1~100的数字;
2)用户总共有5次猜数字的机会;
3)如果用户猜测的数字大于系统给出的数字,打印“too big";
4)如果用户猜测的数字小于系统给出的数字,打印"too small";
5)如果用户猜测的数字等于系统给出的数字,打印"恭喜",并且退出循环;
编写程序代码如下,请完善代码:
#导入random模块
#随机生成1-100的整数并赋值给变量game
time=5
while time>0:
guess=int (input ("请输入你所猜的数字:"))
if (guess>game) :
print ("too big")
elif :
print(" too small' )
else:
print ("恭喜”)
break
time=time-1
print("游戏结束,正确的结果是:",game)
x=10
if x>=10:
Value=3*x
else:
Value=5*x+10
Private Sub Command1_Click( )
a= Val(Text1. Text)
b= Val(Text2. Text)
IfThen
Max=
Else
Max=b
End If
Text3.Text=
End Sub
m=19
if m>=30 or m<20:
print(m)