repl.it
@anonymous/

MuffledRadiantElectricity

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def trouve_voisin(NUMERO):
  s = 1
  i = 1
  while True:
      line = []
      for n in range(s):
          i += 1
          line.append(i)
          if i == NUMERO:
              if n in (0, s-1):
                  print('pas de voisin du dessus')
              else:
                  print('la réponse est:', last_line[n-1])
              return
      s += 2
      last_line = [*line]

trouve_voisin(2012)
Fetching token
?