爱因斯坦的智力题

(1)New WindowsApplication;

(2)Form1上拖拽Lable1、Lable2。 

Public Class Form1

    Dim data As New ArrayList

    Public Enum color
        red
        yellow
        green
        blue
        white
    End Enum

    Public Enum country
        England
        Sweden
        Denmark
        Norway
        German
    End Enum

    Public Enum drink
        tea
        coffee
        milk
        water
        beer
    End Enum

    Public Enum smoke
        Pall_Mall
        Dunhill
        Blends
        Blue_Master
        Prince
    End Enum

    Public Enum position
        A
        B
        C
        D
        E
    End Enum

    Public Enum pet
        dog
        bird
        cat
        horse
        fish
    End Enum

    Public Structure person
        Dim col As color
        Dim cou As country
        Dim dri As drink
        Dim smo As smoke
        Dim pos As position
        Dim pe As pet
    End Structure

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.Label1.Text = "1、在一条街上,有5座房子,喷了5种颜色。" & vbCrLf & _
        "2、每个房里住着不同国籍的人。" & vbCrLf & _
        "3、每个人喝不同的饮料,抽不同品牌的香烟,养不同的宠物。问题是:谁养鱼?" & vbCrLf & vbCrLf & _
  "1、英国人住红色房子" & vbCrLf & _
  "2、瑞典人养狗" & vbCrLf & _
  "3、丹麦人喝茶" & vbCrLf & _
  "4、绿色房子在白色房子左面" & vbCrLf & _
  "5、绿色房子主人喝咖啡" & vbCrLf & _
  "6、抽Pall Mall 香烟的人养鸟" & vbCrLf & _
  "7、黄色房子主人抽Dunhill香烟" & vbCrLf & _
  "8、住在中间房子的人喝牛奶" & vbCrLf & _
  "9、挪威人住第一间房" & vbCrLf & _
  "10、抽Blends香烟的人住在养猫的人隔壁" & vbCrLf & _
  "11、养马的人住抽Dunhill香烟的人隔壁" & vbCrLf & _
  "12、抽Blue Master的人喝啤酒  " & vbCrLf & _
  "13、德国人抽Prince香烟" & vbCrLf & _
  "14、挪威人住蓝色房子隔壁" & vbCrLf & _
  "15、抽Blends香烟的人有一个喝水的邻居"

        Dim per(4) As person
        Dim tt As Integer() = {0, 1, 2, 3, 4}
        pai(tt, 0, 5)

        For intColor As Integer = 0 To data.Count - 1
            For i As Integer = 0 To 4
                per(i).col = CType(CType(data(intColor), Integer())(i), color)
            Next
            For intCountry As Integer = 0 To data.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值