14 lines
213 B
Python
14 lines
213 B
Python
# НОД чисел, алгоритм Евклида
|
|
a = int(input())
|
|
b = int(input())
|
|
while a!=0 and b!=0:
|
|
if a > b:
|
|
a = a % b
|
|
else:
|
|
b = b % a
|
|
if a != 0:
|
|
print(a)
|
|
else:
|
|
print (b)
|
|
|