Hoons.Net/C#

캠퍼스 시삽 과제 3-2) 컬렉션 점찍어 출력하기(While Ver.)

Houkibosi 2012. 8. 13. 15:59

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Collections;


namespace ConsoleApplication3

{

    class Program

    {

        static void Main(string[] args)

        {

            int count=0;

            StringBuilder str = new StringBuilder();

            ArrayList list = new ArrayList();

            list.Add("윤병결");

            list.Add("조현석");

            list.Add("이재민");

            list.Add("김은진");

            list.Add("성연지");

            list.Add("박기완");


            while(true)

            {

                str.Append(list[count++] + ", ");


                if (count == list.Count - 1)

                { 

                    str.Append(list[count + 1] + "\n\n"); 

                    break; 

                }


            }


            Console.WriteLine(str);

        }

    }

}