ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 반복문 연습 1
    C#/수업내용 2021. 3. 9. 17:04
    using System;
    
    namespace Study00
    {
        class Program
        {
            static void Main(string[] args)
            {
                //커멘드센터가 생성되었습니다.
                //커멘드센터 (1500/1500)
                //SCV_0가 생성되었습니다. (45/45)
                //SCV_1가 생성되었습니다. (45/45)
                //SCV_2가 생성되었습니다. (45/45)
                //SCV_3가 생성되었습니다. (45/45)
                string commandCenter = "커멘드센터";
                int commandCenterHp = 1500;
                string scv = "SCV";
                int scvHp = 45;
    
                Console.WriteLine("{0}가 생성되었습니다.", commandCenter);
                Console.WriteLine("{0} ({1}/{2})", commandCenter, commandCenterHp, commandCenterHp);
                for(int i = 0; i < 4; i++)
                {
                    Console.WriteLine("{0}_{1}가 생성되었습니다. ({2}/{3})",scv, i, scvHp, scvHp);
                }
            }
    
        }
    }
    

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

    반복문 연습 3  (0) 2021.03.09
    반복문 연습 2  (0) 2021.03.09
    for문 연습  (0) 2021.03.09
    산술연산자 연습1  (0) 2021.03.09
    형식변환 및 연산자 연습  (0) 2021.03.09
Designed by Tistory.