
Private Sub Command1_Click()
Dim n As Long, k As Integer
Dim f1 As Long, f2 As Long, f As Long
=Val(Text1.Text)
If n >= 20 Or n <= 0 Then
Label2.Caption = "输入的数据有误"
Else
If n <= 2 Then ' 第1,2个元素的值都为1
f = 1
Else
f1 = 1
f2 = 1
For k = 3 To n
f = f1 + f2
f1 = f2
f2 = f
Nextk
End If
Label2.Caption = "斐波那契数列第" + Str(n) + "项的值为" +
End If
End Sub
Private Sub Command1_Click()
Dim a(1 To 100) As String, s As String
Dim i As Integer, m As Integer, n As Integer, pos As Integer
Dim L As Integer, R As Integer, length As Integer, Max As Integer
s = Text1.Text
n = Len(s)
For i = 1 To n
a(i) = Mid(s, i, 1)
Next i
For i = 1 To n
L = i + 1: R = n
Do While L <= R
m = (L + R) \ 2
If Then
L = m + 1
Else
R = m - 1
End If
Loop
If length > Max Then
Max = length : pos = i
End If
i = i + length - 1
Next i
Text2.Text =
End Sub
inp=input("请输入a、b: ") #1
a=float(inp.split( )[0])
b=float(inp.sp1it( )[1]) #2
if a>b: #3
print(a)
else #4
print(b)
Dim a As Integer
Dim k As Integer
s = 0
For k = 1 To 6 Step 2
s = s + k
Next k
Print s
输出s的值是
For i=1To 9
For j=i To 9
a=i*j
List1.AddItem i&"*"&j&"="&a
Next j
Next i
a=eval(input("a="))
b=eval(input("b="))
c=eval(input("c="))
if :
print("周长为", a+b+c)
p=(a+b+c)/2
s=
print("面积为",s)
else:
print("不能构成三角形")
n=0
for i in range(1,4):
n+=i
PRIVATE SUB FORM_CLICK( )
S=1
FOR I = 1 TO 5
S=S*I
NEXT I
PRINT S,I
END SUB
|
图1 |
|
图2 |
图3 |
import pandas as pd
import matplotlib.pyplot as plt
#图表中文显示处理,代码略
df=pd.read_excel("test.xlsx")
score=[]
for i in df.values:
js= ① #①处请选择 (填字母):A . df["信息"]+ df["通用"] / B . i[3]+i[4]
score.append(js)
df["总分"]=score
df1=df.groupby("班级",as_index=False) ["总分"].mean()
plt.title("期中技术平均分")
plt. ② (df1["班级"],df1["总分"],width=0.5) #②处请选择 (填字母):A . plot / B . bar /C . scatter
Dim s As String, i As Integer
Dim c As String, s1 As String
s =“Visual_ Basic_ 2018”
s1=“”
For i=1 To Len(s) Step2
c = Mid(s, i, 1)
If c>=“a”Andc<=“z” Then
s1=c+s1
End If
Next i
Text1. Text = s1
执行该程序段后,文本框Text1显示的内容是( )
| | | | |
| ① | ② | ③ | ④ |
x=10
y=3
print(x%y)