C#/수업내용

반복문 연습 1

박준희 2021. 3. 9. 17:04
728x90
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);
            }
        }

    }
}
728x90