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

namespace Study01
{
    class Program
    {
        enum SPECIES
        {
            TERRAN,
            ZERG,
            PROTOSS
        }
        static void Main(string[] args)
        {
            Console.WriteLine("종족을 선택해주세요.(0 : Terran, 1 : Zerg, 2 : Protoss 중 선택)");

            int input;
            input = Convert.ToInt32(Console.ReadLine());
            SPECIES species;

            
            if(input == 0)
            {
                species = SPECIES.TERRAN;
                Console.WriteLine("{0}을 선택하였습니다.", species);
            }
            else if(input == 1)
            {
                species = SPECIES.ZERG;
                Console.WriteLine("{0}을 선택하였습니다.", species);
            }
            else if (input == 2)
            {
                species = SPECIES.PROTOSS;
                Console.WriteLine("{0}을 선택하였습니다.", species);
            }
            else
            {
                Console.WriteLine("숫자를 잘못입력하였습니다.");
            }
        }
    }
}

'C# > 수업 내용' 카테고리의 다른 글

반복문 두 수의 합 구하기  (0) 2023.01.03
반복문 구구단  (0) 2023.01.03
고블린1  (0) 2023.01.02
늑대1  (0) 2023.01.02
if문 사용 연습  (0) 2023.01.02

+ Recent posts