bonjour,
une solution vba (dure plusieurs 10aines de minutes pour se terminer sur mon i7, 16 GB ram).
Mais que je sache, au loto l'ordre des numéros tirés n'a pas d'importance, si ? En tout cas bonne lecture ;o)
Sub aargh()
Dim t(1 To 1000000, 1 To 1)
sol = 0
col = 0
combine t, sol, col
If sol > 0 Then
col = col + 1
Cells(1, col).Resize(sol, 1) = t
End If
Application.StatusBar = ""
MsgBox "terminé"
End Sub
Sub combine(t, sol, col, Optional n = 1, Optional s = "")
olds = s
For i = 1 To 49
If InStr(s, Chr(i)) = 0 Then
s = s & Chr(i)
If n = 5 Then
sol = sol + 1
r = ""
For j = 1 To 5
r = r & Asc(Mid(s, j, 1)) & ","
Next j
t(sol, 1) = Left(r, Len(r) - 1)
If sol = 1000000 Then
col = col + 1
Cells(1, col).Resize(sol, 1) = t
sol = 0
Application.StatusBar = Format(col / 229, "0.00%")
DoEvents
End If
Else
combine t, sol, col, n + 1, s
End If
s = olds
End If
Next i
End Sub