Vous êtes sur la page 1sur 1

Module Module1

Sub Main()
Dim mat(8, 10)
Dim repf, numdead, rep, nummarc, repc As Integer
nummarc = 0
numdead = 0
For repf = 1 To 8
For repc = 1 To 10
mat(repf, repc) = 1
Next
Next
For rep = 1 To 10
repf = InputBox("Digite la fila donde quiere que caiga la bomba")
repc = InputBox("Digite la columna donde quiera que caiga la bomba")
If mat(repf, repc) = 1 Then
mat(repf, repc) = 0
mat(repf - 1, repc) = 0
mat(repf + 1, repc) = 0
mat(repf, repc - 1) = 0
mat(repf, repc + 1) = 0
Else
mat(repf, repc) = 0
End If
Next
For repf = 1 To 8
For repc = 1 To 10
If mat(repf, repc) = 1 Then
nummarc = nummarc + 1
Else
numdead = numdead + 1
End If
Next
Next

MsgBox("Usted ha matado " & numdead & " marcianos ")

MsgBox("Han quedado vivos " & nummarc & " marcianos ")

End Sub

End Module