elcocodrilotito

MCD Euclides

Oct 16th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #Dise˜nar un programa para obtener el maximo comun divisor segun el algoritmo de Euclides
  2.  
  3. print("Dame 2 numeros que no sean primos entre si, ¿quieres?")
  4. a=int(input("Dame el primero "))
  5. b=int(input("Dame el segundo "))
  6. r=1
  7. while r!=0:
  8.     r=a%b
  9.     a=b
  10.     b=r
  11. print("El maximo comun divisor es %d" %(a))
Add Comment
Please, Sign In to add comment