1、零售价*数量,当数量=10解析表达式解析表达式解析表达式解析表达式t0-h/100*0.5Private Sub Command1_Click()Const pi=3.14159265Dim i As Integer,j As IntegerDim x1 As Single,y1 As SingleDim x2 As Single,y2 As SingleDim a As SingleDim r As SingleDim nodes As IntegerPicture1.Scale(-1.5,1.5)-(1.5,-1.5)建立坐标系Picture1.Clsr=1nodes=15a=2*pi/n
2、odes 弧度数For i=1 To nodes 枚举 求(x1,y1)x1=r*Cos(a*i)y1=r*Sin(a*i)For j=1 To nodes 枚举 求(x2,y2)If i j Then x2=r*Cos(a*j)y2=r*Sin(a*j)Picture1.Line(x1,y1)-(x2,y2),vbBlue 画线 End If Next jNext iEnd Sub注意:需要添加picture1和command1很难得到有效的解析式。穷举法100999a3+b3+c3=xFor x=100 To 999 a=x 100 b=(x Mod 100)10 c=x Mod 10 I
3、f x=a 3+b 3+c 3 Then Print x End IfNext xPrivate Sub Command2_Click()For a=1 To 9 For b=0 To 9 For c=0 To 9 If a*100+b*10+c=a 3+b 3+c 3 Then Print a*100+b*10+c End If Next c Next b Next aEnd Sub a1*x+b1*y=c1 a2*x+b2*y=c2x=(c2-b2*c1)/(a2-a1*b2/b1)y=(c1-a1*x)/b1Private Sub Command1_Click()For x=1 To 20 For y=1 To 33 z=100-x-y If x*5+y*3+z/3=100 Then Print x,y,z End If Next yNext xEnd Sub