using System;

using System.Collections.Generic;


class Program

{

    static void Main()

    {

        // 점심 메뉴 리스트

        List<string> lunchMenus = new List<string>

        {

            "피자",

            "햄버거",

            "김밥",

            "라면",

            "샐러드",

            "스시",

            "치킨",

            "파스타",

            "떡볶이",

            "쌀국수"

        };


        Random random = new Random();


        while (true)

        {

            Console.WriteLine("랜덤 점심 메뉴를 고르시겠습니까? (y/n)");

            string userInput = Console.ReadLine().ToLower();


            if (userInput == "y")

            {

                int randomIndex = random.Next(lunchMenus.Count);

                string selectedMenu = lunchMenus[randomIndex];

                Console.WriteLine($"오늘의 점심 메뉴는: {selectedMenu}");

            }

            else if (userInput == "n")

            {

                Console.WriteLine("프로그램을 종료합니다.");

                break;

            }

            else

            {

                Console.WriteLine("잘못된 입력입니다. 'y' 또는 'n'을 입력해주세요.");

            }

        }

    }

}



==========================================

이렇게 큼직한 프로그램 코드 천천히 분석하면서 코드를 이해하는 게 중요함?