Private Sub Command0_Click() Dim n As Integer, m As Integer, p As Integer, q As Integer, s As Integer, a As Integer s = 23 a = 45 q = 0 If s = n + m + p And a = n + 2 * m + 5 * p Then q = q + 1 End If MsgBox q End Sub 为什么不可以哦?
dim a,b,c as integer,s,n as integer if a>=1 and b>=1 and c>=1 then if a+b+c=23 and 2*a+1*b+5*c=45 then n=n+1 end if end if msgbox "a" & a & "b" & b & "c" & c & "total" & n