Sub 数学わからんからシラミ潰し()
Dim a, b(100), c(100), d, e, f
a = InputBox("サイコロの数を入れてね")
f = InputBox("目の数を入れてね")
Do
e = a
For d = 1 To a
e = e + c(d)
Next
b(e) = b(e) + 1
c(1) = c(1) + 1
If c(1) = f Then
c(1) = 0
For d = 2 To a
If c(d) = f - 1 Then
c(d) = 0
Else
c(d) = c(d) + 1
Exit For
End If
Next
If d = a + 1 Then Exit Do
End If
Loop
For d = 1 To 100
Cells(d, 1) = b(d)
Next
End Sub