- 4 cifras (Quitando los ceros a la izquierda)
- Sus cifras suman 2
- Formado con 2,1,0
- Multiple de 11
Código:
1001
1100
Algoritmo:
Código
Private Sub Form_Load() Dim i As Long For i = 0 To 111 If SumDigits(1001 + i * 11) = 2 Then Debug.Print 1001 + i * 11 Next i End Sub Public Function SumDigits(ByVal lNumb As Long) As Long Dim bvTmp() As Byte Dim i As Long bvTmp = StrConv(Trim$(Str$(lNumb)), vbFromUnicode) For i = LBound(bvTmp) To UBound(bvTmp) SumDigits = SumDigits + (bvTmp(i) - vbKey0) Next i End Function