스토리지

[3.9] 전위.후위 연산자 본문

Unity/수업내용(C#)

[3.9] 전위.후위 연산자

ljw4104 2021. 3. 9. 11:48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study00
{
    class Program
    {

        static void Main(string[] args)
        {
            int level = 1;
            string name = "홍길동";

            Console.WriteLine("{0}님이 레벨업을 했습니다 +{1}", name, level++);
            Console.WriteLine("{0}님의 레벨이 {1}가 되었습니다.", name, level);

            Console.WriteLine(String.Empty);

            int reinforce = 3;
            string weaponName = "장검";

            Console.WriteLine("{0} + {1}", weaponName, reinforce);
            Console.WriteLine("강화시도" + '\n' + "강화실패");
            Console.WriteLine("{0} + {1}", weaponName, --reinforce);

            Console.WriteLine(String.Empty);
        }
    }
}

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

[3.9] 논리연산  (0) 2021.03.09
[3.9] 여러가지 짬뽕  (0) 2021.03.09
[3.9] 복항 할당식  (0) 2021.03.09
[3.9] 값 형식과 참조 형식  (0) 2021.03.09
[3.8] C# 문법 연습 3 - 다크 템플러  (0) 2021.03.08
Comments