Problem 2ã¯ç°¡åã§ãããã£ããããæ°åã¯å帰ã§çæã§ãã¾ãã
@echo off set /a N = 4000000 call :Fibonacci 0 1 echo %ERRORLEVEL% exit /b 0 :Fibonacci setlocal set /a f = %1 + %2 if %f% GTR %N% exit /b 0 call :Fibonacci %2 %f% set /a r = %f% %% 2 if %r% == 0 ( set /a s = %f% + %ERRORLEVEL% ) else ( set /a s = %ERRORLEVEL% ) exit /b %s%
ãã ãé¢æ°åã®ããã«ã¯ãããã«æ¸ãã¾ããããã£ããããæ°åã¨åãåãé¨åãªã©ãåé¢ã§ãã¾ããããã®ãããããã°ãã°ã§ããããããã¾ãããã