배열문

    [C#] 배열 사용해보기

    [C#] 배열 사용해보기

    0. 배열(Array) 배열이란 동일한 타입의 변수를 모아놓은 데이터 집합이다. 1. 주어진 숫자 중에서 최대, 최소값 출력해보기 using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int a = 5, b = 8, c = 9, max = a, min = a; Console.WriteLine("a={0}, b={1}, c={2}", a, b, c); if (max b) min = b; if (min > c) min = c; Console.WriteLine("최대값은 {0}입니다.", max); Console.WriteLi..