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=" ") ⑷程序段执行的结果是:。 |
请利用列表实现程序的功能,在划线处将程序补充完整。
mc=(input (“请输入运动会项目名词(1~6):”)) #输入名次,转化为整型
1st=[7,5,4,3,2,1] #定义一个得分列表
if mc>=1 and mc<=6 : #名次在1-6名之间,索引位置
df= #根据索引取列表中相应的成绩
print(“项目得分为:”, )
else:
print(“输入的名次不在[1~6]范围!”)
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command2_Click()
Dim a As Single, b As Single, c As Single
Dim x1 As Single, x2 As Single, det As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
det = ‘(根的判别式b2-4ac)
Select Case det
Case Is > 0
x1 = (-b + Sqr(det)) / (2 * a)
x2 = (-b - Sqr(det)) / (2 * a)
Text4.Text = "方程有两个实数根" & " x=" & Str(x1) & " x=" & Str(x2)
Case Is = 0
Text4.Text = "方程有两个相等的实数根 x=" & Str(x1)
Case
Text4.Text = "此方程无实数根"
End Sub
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中的值为2,4,6,则打印“x的值为2,4,6”;
若x中的值为10到20之间的数,则打印“x的值为10~20”;
若x中的值为大于20的数,则打印“x 的值大于20”;
否则,打印“x不在范围内”;
Private Sub Command1_Click()
x = Val(Text1.Text)
Select Case x
Case
Print "x的值为2,4,6"
Case
Print "x的值为10~20"
Case
Print "x的值大于20"
Print "x不在范围内"
End Select
End Sub
下列程序的功能是:当x<50时,y=0.8×x;当50≤x≤100时,y=0.7×x;当x>100时,输入的数据超出范围。请填空。
Private Sub Command1_Click()
Dim x As Single
x=InputBox("请输入x的值!")
Case x < 50
y=0.8 * x
Case 50 To 100
Print "输入的数据超出范围!"
End Select
Print x, y
End Sub
if int (input ( ) ) %5= =0:
print("yes")
if int (input ( ) ) %5!=0:
print("no")
如果输入7,则输出( )。
G=int(input(‘请输入原始成绩:’)) If print(‘Great’) elif G<85 and G>=70: print(‘Good’)
print(‘Medium’) else: print(‘Bad’) |
图1
Private Sub Command1_Click( )
w= val (Text1. text)
if then
f=38
Else
f=
End If
Text2. text=f
End Sub
请把以下选项填在对应的序号处①、②、③
A.暴雨红色预警信号是否生效
B.正常回校上课
C.学生停课在家自主学习
x=20
if x>=100 then y=5*x else y=4*x
end if
x=3
Select Case x
Case 5
Print "优秀"
Case 4
Print "良好"
Case 3
Print "通过"
Case Else
Print "不通过"
End Select
a=int(input("请输入买苹果的斤数:")
if :
s=10*a
else:
s=8*a
print("苹果费用:"+str(s))
a= 1
b=2
if (a+b>3) :
print("yes")
else:
print("no")
x=float(input('请输入用水量:')
if x<=100:
print('您的水费是',x*0.6,'元')
elif x>100 and x<=200:
print('您的水费是',x*0.7,'元')
else:
print('您的水费是',x*0.9,'元') *
x=4 y=3
if x>y:
print(x)
else:
print(y)
屏幕上输出的内容是()