Skip to content

Instantly share code, notes, and snippets.

@thinkphp

thinkphp/input.py

Created Nov 12, 2020
Embed
What would you like to do?
import sys
def _euclid(a,b):
if(b==0):
return a
else:
return _euclid(b,a%b)
def _euclid_it(a,b):
while(b):
r = a % b
a = b
b = r
return a
def main():
a=int(input("a="))
b=int(input("b="))
#line = sys.stdin.readline()
#ab = line.split("\n")[0]
#ab = ab.split(" ")
#a = int(ab[0])
#b = int(ab[1])
print _euclid_it(a,b)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment