diff --git a/main.py b/main.py index 4c0c135f61696bcf42c375ca5ab62aa5b105afc8..7f493ecd69eea798cfc4a3cd025ccca4ab1e8584 100644 --- a/main.py +++ b/main.py @@ -1 +1,16 @@ -print('欢迎来到 InsCode') \ No newline at end of file +def main(): + a = int(input("请输入a的值:")) + b = int(input("请输入b的值:")) + if b == 0: + print("data error") + return -1 + else: + c = a % b + while c != 0: + a = b + b = c + c = a % b + print(b) + + +main() \ No newline at end of file diff --git a/test01.py b/test01.py new file mode 100644 index 0000000000000000000000000000000000000000..7f493ecd69eea798cfc4a3cd025ccca4ab1e8584 --- /dev/null +++ b/test01.py @@ -0,0 +1,16 @@ +def main(): + a = int(input("请输入a的值:")) + b = int(input("请输入b的值:")) + if b == 0: + print("data error") + return -1 + else: + c = a % b + while c != 0: + a = b + b = c + c = a % b + print(b) + + +main() \ No newline at end of file