プログラミングとかブログ

Unity/C#/SRPGStudio/RPGツクールMVの情報とかその他気になったことを調べて書きます。

【C#】fizzbuzz

    using System;
    class Program
    {
        public static void Main()
        {
            for (int i = 1; i < 100; i++)
            {
                if (i % 3 == 0 && i % 5 == 0) { Console.WriteLine("fizzbuzz"); }
                else if (i % 3 == 0) { Console.WriteLine("fizz"); }
                else if (i % 5 == 0) { Console.WriteLine("buzz"); }
                else Console.WriteLine(i);
            }
        }
    }

paiza.ioのを乗っけときます。