复制代码
- @echo off
- echo 输入要求最大公因数的两个数
- set /p a=num 1 :
- set /p b=num 2 :
- set c=0
- if %a% gtr %b% (goto a) else if %a% equ %b% (goto ab) else goto b
- :a
- set /a c=%a% %% %b%
- set a=%b%
- set b=%c%
- if %c% neq 0 (goto a) else goto en
- :b
- set z=%a%
- set a=%b%
- set b=%z%
- goto a
- :ab
- :en
- echo ^|-----^> %a%
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |