a=14
b=30
select case b\10 ‘“\”是整除,运算结果只保留整数部分。
Case 0
c=a+b
Case 1 to 9
c=a*10+b
Case 10 to 99
c=a*100+b
End select
Print c
Private Sub Command1_Click()
Dim x As Integer
x=Val(Text 1.Text)
Select Case
Case Is>=90
Text2.Text=“A”
Case Is>=80
Text2.Text=“B”
Case Is
Text2.Text=“C”
Case Is>=60
Text2. Text=“D”
Case Else
End Select
End Sub
第一步,设置报警阈值为37度;
第二步,获取人的体温;
第三步,获取的人的体温与报警阈值作比较,如果体温不超过报警阈值,则显示“正常通行”;否则显示“体温高报警”。
图1
A.
B.
C.
D.
f=37
t= ("请输入检测的体温:")
t=eval(t)
if t<f
print("正常体温")
:
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=" ") ⑷程序段执行的结果是:。 |
Private Sub Command1_Click()
Dim x As Integer
x = Val(Text1.Text)
Select Case x
Case Is >= 450
Text2.Text = "优秀"
Case Is >= 400
Text2.Text = "良好"
Case Is > 350
Text2.Text = "中等"
Case Is >= 300
Text2.Text = "及格"
Case Else
Text2.Text = "不及格"
End Select
End Sub
语法错误:
该程序运行后,若在文本框中输入350,则输出为:
if i==1:
s=1
a=5
if a>5:
print(5)
print(3)
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
s = input("请输入一个数字")
print("s是个小于10的数字" if int(s)<10 else "s是大于10的数字")
①p=5 (a+b+p) ②if a>0 then b=b+1
③t1.text=”请输入密码:” ④For i=1 to 10 do j=j*2
x=10
if x>=10:
Value=3*x
else:
Value=5*x+10