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

namespace Study01
{
    class Program
    {
        static void Main(string[] args)
        {
            //    int hp = 10;
            //    int att = 10;
            //    bool isDie = hp - att <= 0;
            //    if (isDie)
            //    {
            //        Console.WriteLine("사망");
            //    }
            //    else Console.WriteLine("생존");

            int level = 1;
            float exp = 98.56f;
            float getExp = 45.23f;
            Console.WriteLine("{0} 경험치를 획득하였습니다.", getExp);

            exp = exp + getExp;

            if(exp >= 100)
            {
                level++;
                Console.WriteLine("레벨이 {0}에서 {1}가 되었습니다.", level - 1, level);

                exp = exp - 100f;
                Console.WriteLine("현재 경험치 : {0}", exp);
            }
        }
    }
}

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

반복문 두 수의 합 구하기  (0) 2023.01.03
반복문 구구단  (0) 2023.01.03
if문 종족 선택  (0) 2023.01.02
고블린1  (0) 2023.01.02
늑대1  (0) 2023.01.02

+ Recent posts