wine_ value=int (input ("请输入酒精含量:") )
if wine. _value<20:
print ("不构成酒驾")
else:
if 80>wine_ value>=20:
print ("构成酒驾")
else:
print ("构成醉驾")
Private Sub Form_Click( )
Dim a, b, c, s As Integer
a=9
b=41
c=2*(a+b)
s=a*c
Private Sub Form_Click( )
Dim a As Integer, b As Integer
If a>b Then
a=a-b
Else
a=b+a
End if
Print a
Private Sub Form_Click( )
Dim x As Integer, a As Integer
x=0
a=0
For j=1 to 5
a=a+j
Next j
x=j
Print x, a
End Sub
Private Sub Form_Click( )
Dim x As Integer
x=0
Do While x<50
x=(x+2)*(x+3)
n=n+1
Loop
Print x,n
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
Sub mult( )
Dim Sum As Integer
Sum=0
Dim i as integer
For to 50
If i MOD 2= Then
End if
Next i
Print sum
End Sub
For i = 1 To 5
For j = 2 To i
Print "*";
Next j
Next i
Private Sub command1_Click()
Dim n As Integer, i As Integer, s As Double
n = 100
s = 0
For i = 1 To n
Next i
Print s
End Sub
若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
Dim i As Integer, sum As Integer
sum = 0
For i = 2 To 10
If i Mod 2 <> 0 And i Mod 3 = 0 Then
sum = sum + i
End If
Next i
Print sum
End Sub
程序运行后,单击窗体,输出结果为。
for i in range(1,21,2):
print("#")
from microbit import *
while True:
water_ level =pinl. read_ analog () #将p1引脚的模拟值设为变量“water_ level”
if water_ level<300:
display. show (Image. SAD)
else:
display. show (Image. HAPPY)
a=3
b=5
if a==b:
print(b)
else:
print(a)
|
a |
b |
a % b |
|
123456 |
7890 |
5106 |
|
7890 |
5106 |
2784 |
|
5106 |
2784 |
2322 |
|
2784 |
2322 |
462 |
|
2322 |
462 |
12 |
|
462 |
12 |
6 |
|
12 |
6 |
0 |
程序如下:
|
a = int(input("输入第一个数:")) b= int(input("输入第二个数:")) c= ① while ② : print("它们的最小公倍数是:",c//a) |
s=0
for i in range (1,5):
s=s+i
print("i=",i,"s=",s)
①
②
③
④
a=4
s=0
while a>=0:
s=s+a
a=a-1
print(s,a)
Num1=5
Num2=4
Num1=Num2
print(Num1,Num2)
c1=356
c2=365
c1=c2
print(c1)
屏幕上输出的内容是( )
