一个数字游戏题

一个数字除法游戏题,题目暂时忘了

#!/usr/bin/python3

num = []
cnt = 0;
for i in range(0,10):
  for j in range(0,10):
    for k in range(0,10):
      for m in range(0,10):
        res = 100000 + 10000*i + 1000*j +100*k + 70 + m
        if(res*7>=1000000):
          continue
        elif((res*7//10000)%10==7):
          for n in range(1,10):
            if((res*n//100)%10==7 and res*n>=1000000):
              cnt = cnt + 1
              #print(i, j, k, m, n)
              num.append(res)
              print(res)
#print(cnt)
#print(num)

print("===================")
cnt = 0;
for item in num:
  for i in range(1,10):
    for j in range(0,10):
      for k in range(0,10):
        for m in range(0,10): 
          res = item * (10000*i + 1000*j + 700 + 10*k +m)
          if(res>1000000000 and res<10000000000):
            if((res//10000000)%10==7):
              first = res - 10000*i*item
              if(first>1000000000 and first<10000000000):
                if((first//10000)%10==7):
                  second = first - 1000*j*item
                  if(second>10000000 and second<100000000):
                    if((second//1000000)%10==7):
                      third = second - 700*item
                      if(third>10000000 and third<20000000):
                        if((10*k*item//1000)%10==7):
                          fourth = third - 10*k*item
                          if(fourth==m*item and fourth<1000000):
                            cnt = cnt+1
                            div = (10000*i + 1000*j + 700 + 10*k +m)
                            print(item)
                            print(div)
                            print(res)
print(cnt)

你可能感兴趣的:(一个数字游戏题)