-
Notifications
You must be signed in to change notification settings - Fork 0
/
33.py
35 lines (32 loc) · 838 Bytes
/
33.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
l = []
for i in range(10, 100):
for j in range(10, 100):
if i >= j: continue
v = float(i)/j
si = str(i)
sj = str(j)
a, b = si[0], si[1]
c, d = sj[0], sj[1]
if a == c and a != '0' and d != '0':
x = float(b)/float(d)
if x == v:
l.append((i,j))
elif a == d and a != '0' and c != '0':
x = float(b)/float(c)
if x == v:
l.append((i,j))
elif b == c and b != '0' and d != '0':
x = float(a)/float(d)
if x == v:
l.append((i,j))
elif b == d and b != '0' and c != '0':
x = float(a)/float(c)
if x == v:
l.append((i,j))
num = 1
den = 1
for m,n in l:
print m,n
num *= m
den *= n
print num, den