2007å¹´12æ02æ¥04:00 ã«ãã´ãªã¢ã«ã´ãªãºã ç¾é¸ ç§ãã¨ããã¢ã«ã´ãªãºã æ¬ãæ¸ããã¨ã«ãã訳 ã¢ã«ã´ãªãºã ãè©ä¾¡ããã®ã¯ãããã«ã¨ã£ã¦ãé£ããã ã¢ã«ã´ãªãºã - 186::Diary * ãã¨ã¡ã¢åã®ã¨ãã®æåã®å¼ã³åºãåæ°ã®è©ä¾¡ãééã£ã¦ããã. 1åç®ã¯é¢æ°ããã¤ã¼ããªå®è£ ã§è©ä¾¡ãããã. ã¨ãããããã®ä¸ãã«é¢ãã¦ééããªã®ã¯ç§ã®å çºè¨ã§ã¯ãªãããã®çªã£è¾¼ã¿ã®æ¹ãªã®ã§ããã ãã®ãã¨ã¯ã以ä¸ãè¦ãã°ä¸ç®çç¶ã§ããã ãã¤ã¼ã ããã°ã©ã : var c = 0; function fib(n){ c++; if (n <= 2) return 1; return fib(n-1) + fib(n-2); } (function(n){ p('fib('+n+') = ' + fib(n) + ', count = ' + c) })(25) åºå: ã¨ã©ã¼: ã¡ã¢å ããã°
{{#tags}}- {{label}}
{{/tags}}