c#/복습 공부

배열 swap 다시 복습 2번

이지훈26 2021. 8. 31. 23:06

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class APP
{

    
    public APP()
    {
        //정수형 배열을 선언하고 초기화 한다
        //요소의 값을 할당하고 각요소를 출력한다

        //인덱스 3번에 "장검"을 출력해야 겠다.
        //출력할 때 (->)를 넣어야지

        string[] arr;
        arr = new string[5];
        arr[3] = "장검";
        
        foreach(string name in arr)
        {
            Console.WriteLine("-> {0}", name);
        }
    }
}