2013å¹´3æ2æ¥åææ¥ [VBA] é·ãé·ã FizzBuzz VBA ã§ã·ã§ã¼ã ã³ã¼ãã£ã³ã°ãããã¨ã¯é£ããããªããã£ãããã³ã° ã³ã¼ãã£ã³ã°ãã¦ã¿ã¦ã¯ã©ãããç¡è«ãDRY ååãç ´ããã«ããã㯠VBA ã®ã©ã¤ãã©ãªä¸è¶³ã¸ã®ææ¦ã ãé¡æ㯠FizzBuzz ã§ãã¾ããFizzBuzz ã®ã¡ã¤ã³ã®å¦çã¨è¨ã£ã¦ããé¨åãæ°å¤ãåã£ã¦é©åãªæååãè¿ãé¢æ°ãå®è£ ããã' Program.bas Option Explicit Function FizzBuzz(ByVal n As Long) As String Select Case BitFlag(n Mod 5 = 0, n Mod 3 = 0) Case 0: FizzBuzz = CStr(n) Case 1: FizzBuzz = "Fizz" Case 2: FizzBuzz = "Buzz" Case 3: FizzBu
{{#tags}}- {{label}}
{{/tags}}