ï¼Twitterããåç §ããããã®ã¡ã¢ã§ãï¼ ã¾ããããããé¢æ°ãã¯ãåãå½¢ã®è¨ç®ãä½åº¦ãæ¸ããªãããã®ä»çµã¿ãã§ãããã¨ãååã«ç解ããï¼ãããï¼ããã®ä¸ã§ã sum(0) = 0 sum(1) = 0+1 sum(2) = 0+1+2 sum(3) = 0+1+2+3 sum(4) = 0+1+2+3+4 ...ããåãè¨ç®ãä½åº¦ãæ¸ãã¦ãããããã sum(0) = 0 sum(1) = sum(0)+1 sum(2) = sum(1)+2 sum(3) = sum(2)+3 sum(4) = sum(3)+4 ...ã¨æ¸ãæããããããä¸è¬åãã㨠sum(0) = 0 sum(n) = sum(n-1)+n ï¼n>0ã®å ´åï¼ã¤ã¾ã sum(n) = if n=0 then 0 else sum(n-1)+nã¨ãªã 追è¨ï¼n<0ã®å ´åã¯æ°ã«ãããªã
{{#tags}}- {{label}}
{{/tags}}