编写程序求解下述韩信点兵问题:有一对士兵,从1至5依次报数时,最后1人报1,;从1至6依次报数时,最后一人报5;从1至7

1个回答

  • ‘2111个士兵

    ’vb代码

    Private Sub Command1_Click()

    Dim i As Long

    Do

    i = i + 1

    If i Mod 5 = 1 And i Mod 6 = 5 And i Mod 7 = 4 And i Mod 11 = 10 Then Exit Do

    Loop

    Print i

    End Su