Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. required_inputs = int(input("For how many numbers would you like to find their GCD?: "))
  2. received_inputs = []
  3.  
  4. for num in range(0, required_inputs):
  5. values = int(input())
  6. received_inputs.append(values)
  7. if len(received_inputs) == 0:
  8. values = int(input())
  9. received_inputs.append(values)
  10.  
  11. def GCD(a, b):
  12. if b == 0:
  13. return a
  14. else:
  15. return GCD(b, a % b)
  16.  
  17. print(GCD(received_inputs[0], received_inputs[1]))
Add Comment
Please, Sign In to add comment