
https://www.youtube.com/watch?v=uGM4YY1d1V8&list=PLO56HZSjrPTB4NxAsEP8HRk6YKBDLbp7m&index=24










using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            // 0부터 9까지 반복
            for (int i = 0; i < 10; i++)
            {
                WriteLine(i);
            }
            // for문 안에서 선언된 변수는 블록을 빠져나가면 소멸
            for (int i = 0; i < 10; i++)
            {
                WriteLine(i);
            }
            WriteLine(i); // error
                          // 구문 안에서 여러 개의 변수 선언 가능 : 추천 안함
            for (int i = 0, j = 0; i < 10 && j < 20; i++, j += 2)
            {
                WriteLine(i);
                WriteLine(j);
            }
        }
    }
}


using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 2; i <= 9; i++)
            {
                for (int j = 1; j <= 9; j++)
                {
                    WriteLine($"{i} X {j} = {i * j}");
                }
            }
        }
    }
}

using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 1; i <= 9; i++)
            {
                for (int j = 2; j <= 9; j++)
                {
                    Write($"{j} X {i} = {j * i} \t");
                }
            }
        }
    }
}


using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 1; i <= 5; i++)
            {
                for (int j = 1; j <= i; j++)
                {
                    Write("*");
                }
                WriteLine();
            }
        }
    }
}

using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 5; i >= 1; i--)
            {
                for (int j = 1; j <= i; j++)
                {
                    Write("*");
                }
                WriteLine();
            }
        }
    }
}

using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 1; i <= 5; i++)
            {
                for (int j = 1; j <= (5-i); j++)
                {
                    Write(" ");
                }
                for (int j = 1; j <= i; j++)
                {
                    Write("*");
                }
                WriteLine();
            }
        }
    }
}

using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            for(int i = 5; i >= 1; i--)
            {
                for (int j = 1; j <= (5-i); j++)
                {
                    Write(" ");
                }
                for (int j = 1; j <= i; j++)
                {
                    Write("*");
                }
                WriteLine();
            }
        }
    }
}


using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            while(i < 10)
            {
                WriteLine(i);
                i++;
            }
        }
    }
}



using System;
using static System.Console;
namespace testProject
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            do
            {
                WriteLine(i);
            } while (i != 0);
        }
    }
}






