Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim e As String
Dim a_fz As Long
Dim a_fm As Long
Dim b_fz As Long
Dim b_fm As Long
Dim c_fz As Long
Dim c_fm As Long
Dim d_fz As Long
Dim d_fm As Long
Dim e_fz As Long
Dim e_fm As Double
Dim fz As Long
Dim fm As Long
Dim temp As Long
Dim m As Long
Dim n As Long
Dim r As Long
Dim fs As String
a = "1/2"
b = "1/3"
c = "3/5"
d = "4/9"
e = "5/7"
wz = InStr(a, "/")
a_fz = Left(a, wz - 1)
a_fm = Right(a, Len(a) - wz)
wz = InStr(b, "/")
b_fz = Left(b, wz - 1)
b_fm = Right(b, Len(b) - wz)
wz = InStr(c, "/")
c_fz = Left(c, wz - 1)
c_fm = Right(c, Len(c) - wz)
wz = InStr(d, "/")
d_fz = Left(d, wz - 1)
d_fm = Right(d, Len(d) - wz)
wz = InStr(e, "/")
e_fz = Left(e, wz - 1)
e_fm = Right(e, Len(e) - wz)
fm = a_fm * b_fm * c_fm * d_fm * e_fm * 5
fz = a_fz * b_fm * c_fm * d_fm * e_fm + b_fz * a_fm * c_fm * d_fm * e_fm + c_fz * a_fm * b_fm * d_fm * e_fm + d_fz * a_fm * b_fm * c_fm * e_fm + e_fz * a_fm * b_fm * c_fm * d_fm
m = fm
n = fz
If m < n Then temp = m: m = n: n = temp
r = m Mod n
Do While (r <> 0)
m = n
n = r
r = m Mod n
Loop
fm = fm / n
fz = fz / n
fs = Trim(Str(fz)) & "/" & Trim(Str(fm))
Print fs