New project, copy the following code into Form1, run Option Explicit '-------------------- Judgment Conditions ---------- - '1 British live red house cyg = Fred'2 Swedish raising dog CRD = WDOG'3 Danish drink tea cdm = jtea'4 green house on white house left fgreen = fwhite-1'5 green house owner drink coffee FGreen = jcoffee'6 pumping a Pall Mall cigarette child bird Ypallmall = wbird'7 yellow house master smoking Dunhill Cigarette fyellow = ydunhill'8 live in the middle house drink milk Jmilk = 3'9 Norwegian people living in the first room CNW = 1'10 smoke Blends cigarette live in the Nursing cat partition ABS (YBLENS-WCAT) = 1'11 hippo people to smoke Dunhill cigarettes Nunhill cigarette part of ABS (whorse-ydunhill) = 1'12 smoke Blue Master Man drinking beer ybluemaster = jbeer'13 German smoke Prince cigarette cdg = YPRINCE'14 Norwegian people living blue house next door ABS (cnw-fblue) = 1 $ 15 smoke Blends cigarette with a drink of water neighbor ABS (Yblends -jwater = 1
'--------------------- Related elements -------------------' Green house blue house Red house yellow house white house 'Norwegian German British Dane Swedish' coffee milk milk tea beer 'Pallmall Prince Blens Dunhill Blue Master' bird cat horse fish 'variable DIM CDG, CDM, CNW, CRD, CYG' nationality Dim fBlue, fGreen, fRed, fWhite, fYellow 'house Dim jBeer, jCoffee, jMilk, jTea, jWater' wine Dim wBird, wCat, wDog, wFish, wHorse 'pet Dim yBlends, yBlueMaster, yDunhill, yPallMall, yPrince' smoke
Private Sub Plyan () 'All Running Smoke' Yblends, Ybluemaster, Ydunhill, Ypallmall, Yprince 'Smoke
'ybluemaster = jbeer'ydunhill = fyellow'ypallmall = wbird'yprince = cdg
'ABS (YBLENS-WCAT) = 1'Abs (Yblends-jwater) = 1'Abs (whorse-ydunhill) = 1 Dim i as integer Dim J AS Integer Dim s String for Yblends = 1 To 5 if ABS (Yblends - wCat) = 1 And Abs (yBlends - jWater) = 1 Then yBlueMaster = jBeer If yBlueMaster <> yBlends Then yDunhill = fYellow If yDunhill <> yBlends And yDunhill <> yBlueMaster And Abs (wHorse - yDunhill) = 1 Then yPallMall = wBird If yPallMall <> yBlends And yPallMall <> yBlueMaster And yPallMall <> yDunhill Then yPrince = 15 - yBlends - yBlueMaster - yDunhill - yPallMall If yPrince = cDG Then 'print cDG, cDM, cNW, cRD, cYG' print fBlue, fGreen, fRed, FWHITE, FYELOW 'Print Jbeer, JCoffee, Jmilk, Jtea, Jwater' Print Wbird, WCAT, WDOG, WFISH, Whorse 'Print Yblends, Ybluemaster, Ydunhill, Ypallmall, Yprince 'Print CDG, CDM, CNW, CRD, CYG S = "" for i = 1 to 5 if CDG = I THEN S = S & "Germany" IF CDM = I THEN S = S & "Denmark" IF CNW = I THEN S = S & "Norway" IF CRD = I THEN S = S & "Sweden" if Cyg = I Then S = S & "UK"
Next I print s' print fblue, fgreen, fred, fwhite, fyellow s = "" for i = 1 to 5 if fblue = I THEN S = S & "Blue" if fgreen = I Then S = S & "Green" IF Fred = I THEN S = S & "Red" if fwhite = I THEN S = S & "White" if fyellow = I THEN S = S & "Yellow" Next I Print S 'Print Jbeer, JCoffee, Jmilk, Jtea, jwater S = "" for i = 1 to 5 if jbeer = I TEN S = S & "Beer" if jcoffee = I THEN S = S & "Coffee" IF JMilk = I THEN S = S & "Milk" IF JTEA = i THEN S = S & "Tea" IF jwater = I THEN S = S & "Water" Next I Print S 'Print Wbird, WCAT, WDOG, WFISH, Whorse S = "" for i = 1 to 5 if wbird = I THEN S = S & "Bird" IF WCAT = I THEN S = S & "Cat" IF WDOG =
I THEN S = S & "Dog" if wfish = I THEN S = S & "Fish" IF Whorse = I THEN S = S & "Ma" Next I Print S 'Print Yblends, YBLUEMASTER, YDUNHILL, YPALLMALL, YPRINCE S = "" For i = 1 to 5 if Yblends = I THEN S = S & "BLENDS" if YBLUEMASTER = I THEN S = S & "Bluemaster" if Ydunhill = I THEN S = S & "Dunhill" if Ypallmall = I THEN S = S & "Pallmall" if Yprince = I THEN S = S & "Prince" Next I print s if cdg = wfish then s = "German fish" IF CDM = Wfish Then S = "Danish fish" IF CNW = wfish then s = "Norwegian people raise fish" IF crd = wfish Ten s = "Swedish fish" if cyg = wfish then s = "British fish" Print "-------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- - "Print s end if end if end if Endness Subprivate Sub Plchwu () 'All Arrange Pet' Wbird, WCAT, WDOG, WFISH, Whorse 'Pet
'wdog = crd wdog = crd for wbird = 1 to 5 for wct = 1 to 5 if wct <> wbird dam wdog <> wbird and wdog <> wct dam1 for wfish = 1 to 5 if wfish <> wbird and wfish < > WCAT and WFISH <> wdog dam = 15 - wbird - wcat - wdog - wfish plyn end if next wfish Endness Subprivate Sub Pljiu () 'full-line' JBeer, JCoffee, Jmilk, Jtea, Jwater 'wine
'jcoffee = fgreen'jmilk = 3'jtea = cdm jmilk = 3 jtea = cdm for jbeer = 1 to 5 jcoffee = fgreen if jcoffee <> jbeer theen if jmilk <> jbeer and jmilk <> jbeer and jtea <> jbeer and Jtea <> jcoffee and jtea <> jmilk dam, jwater = 15 - JBeer - JCoffee - JMILK - JTEA PLCHWU END IF END IF END IF NEXT JBEER
End Sub
Private sub plfangzi () 'full-rated house' FBLUE, FGreen, Fred, Fwhite, Fyellow 'house
'fred = cyg'fwhite = fgreen 1
'ABS (CNW-FBLUE) = 1 for fblue = 1 to 5 if ABS (CNW - fblue) = 1 Then for fgreen = 1 to 5 if fgreen <> fblue1 Fred = cyg if Fred <> fblue and fred <> fgreen Then fWhite = fGreen 1 If fWhite <> fBlue And fWhite <> fRed And fWhite <6 Then fYellow = 15 - fBlue - fGreen - fRed - fWhite PLJiu End If End If End If Next fGreen End If Next fBlueEnd SubPrivate Sub PLGuoJI () 'Full alignment nationality' cdg, cdm, cnw, crd, cyg'cnw = 1 CNW = 1 for cdg = 2 to 5 for cdm = 2 to 5 if cdm <> cdg dam = 2 to 5 if crd <> cdm And crd <> cdgim - CDM - CNW - CRD PLFANGZI END IF NEXT CRD END IF NEXT CDM NEXT CDG
End Sub
Private sub form_load () me.autoredraw = true plguojiend SUB