過去ログ

???
10*b+c+a/10や10*a+b+c/10を他の文字に入れると桁落ちがおきてしまいます。

Option Explicit
Sub Macro1()
Sheets("Sheet1").Select
Cells(1, 1).Value = 0
Dim a As Integer
Dim b As Integer
Dim c As Integer
For a = 0 To 9
For b = a To 9
For c = b To 9
If 10 * a + b + c / 10 > 0 Then
If (10 * b + c + a / 10) - (10 * a + b + c / 10) > 0 Then
If (10 * b + c + a / 10) - (10 * a + b + c / 10) = (10 * c + a + b / 10) - (10 * b + c + a / 10) Then
Cells(1, 1).Value = Cells(1, 1).Value + 1
Cells(Cells(1, 1).Value, 2).Value = a
Cells(Cells(1, 1).Value, 3).Value = b
Cells(Cells(1, 1).Value, 4).Value = c
Cells(Cells(1, 1).Value, 5).Value = ((10 * b + c + a / 10) - (10 * a + b + c / 10)) / 1.5
Range("E" & Cells(1, 1).Value).Select
End If
End If
End If
Next c
Next b
Next a
End Sub
   8月26日(木) 10:55:29     36641

過去問題一覧へ戻る