TOPIC

Runtime Error

Lucas Grunheidt asked 9 months ago

Oi gente, segue meu código:

def pytag(v):

v.sort(reverse=True) 

if(primitive(v) and v[0]**2 == v[1]**2 + v[2]**2):

  print("tripla pitagorica primitiva")
elif(v[0]**2 == v[1]**2 + v[2]**2):

  print("tripla pitagorica")
else:

  print("tripla")

def mdc(a,b):

while b:

a, b = b, a%b

return a

def primitive(v):

if((mdc(v[0],v[1])==1) and (mdc(v[0],v[2])==1) and (mdc(v[1],v[2])==1)):

return True

return False

while True:

a = input()

if(not a):

break

a = a.split(" ")

a = list(map(int, a))

pytag(a)

Ele funciona na minha maquina, mas está dando runtime error. O que pode ser o problema?

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.