2009年12月20日日曜日

ネスト(入れ子)で5重ループを作成してみる。

using System;


class MainClass
{
    static void Main()
    {
        for (int a = 0; a < 5; a++)
        {
            for (int b = 0; b < 5; b++)
            {
                for (int c = 0; c < 5; c++)
                {
                    for (int d = 0; d < 5; d++)
                    {
                        for (int e = 0; e < 5; e++)
                        {
                            Console.Write(a);
                            Console.Write(b);
                            Console.Write(c);
                            Console.Write(d);
                            Console.WriteLine(e);
                        }
                    }
                }
            }
        }
    }
}

0 コメント:

コメントを投稿