ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 변수정의 및 할당 출력 연습 10개
    C#/수업과제 2021. 3. 9. 00:37

    1.화살 세례

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "화살 세례";
                string equipmentType = "한손 무기";
                float minDps = 2180.8f;
                float maxDps = 2554.4f;
                string dps = "초당 공격력";
                int minDamage = 984;
                int maxDamage = 1175;
                float attacksPerSecond = 1.60f;
                int requireLevel = 70;
                eClass characterClass = eClass.DemonHunter;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, characterClass);
                Console.WriteLine("{0}-{1}",minDps, maxDps);
                Console.WriteLine(dps + enter);
                Console.WriteLine("무기공격력 ({0}-{1})", minDamage, maxDamage);
                Console.WriteLine("초당 공격 횟수 {0:.00}{1}", attacksPerSecond, enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

     

    2.혈마검

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "혈마검";
                string equipmentType = "한손 무기";
                float minDps = 1822.3f;
                float maxDps = 2231.8f;
                string dps = "초당 공격력";
                int minDamage = 965;
                int maxDamage = 1156;
                float minAttacksPerSecond = 1.58f;
                float maxAttacksPerSecond = 1.61f;
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}-{1}",minDps, maxDps);
                Console.WriteLine(dps + enter);
                Console.WriteLine("무기공격력 ({0}-{1})", minDamage, maxDamage);
                Console.WriteLine("초당 공격 횟수 {0:.00}-{1:.00}{2}", minAttacksPerSecond, maxAttacksPerSecond, enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    3.해방된 화살

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "해방된 화살";
                string equipmentType = "양손 무기";
                float minDps = 2288.8f;
                float maxDps = 2731.6f;
                string dps = "초당 공격력";
                int minDamage = 1124;
                int maxDamage = 1342;
                float minAttacksPerSecond = 1.47f;
                float maxAttacksPerSecond = 1.50f;
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}-{1}",minDps, maxDps);
                Console.WriteLine(dps + enter);
                Console.WriteLine("무기 공격력 ({0}-{1})", minDamage, maxDamage);
                Console.WriteLine("초당 공격 횟수 {0:.00}-{1:.00}{2}", minAttacksPerSecond, maxAttacksPerSecond, enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    4.하시르의 사자궁

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "하시르의 사자궁";
                string equipmentType = "양손 무기";
                float dps = 670.6f;            
                string dpsText = "초당 공격력";
                int damage = 143;
                float attacksPerSecond = 1.40f;            
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}", dps);
                Console.WriteLine(dpsText + enter);
                Console.WriteLine("무기 공격력 {0}", damage);
                Console.WriteLine("초당 공격 횟수 {0:.00}{1}", attacksPerSecond, enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    5.피의 형제

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "피의 형제";
                string equipmentType = "양손 무기";
                float minDps = 1730.4f;
                float maxDps = 1795.7f;
                string dps = "초당 공격력";
                int minDamage = 1205;
                int maxDamage = 1251;
                float attacksPerSecond = 1.15f;            
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}-{1}", minDps, maxDps);
                Console.WriteLine(dps + enter);
                Console.WriteLine("무기 공격력 ({0}-{1})", minDamage, maxDamage);
                Console.WriteLine("초당 공격 횟수 {0:.00}{1}", attacksPerSecond, enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    6.프라이데르의 진노

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "프라이데르의 진노";
                string equipmentType = "보조 장비";
                eClass characterClass = eClass.Crusader;
                int minPower = 626;
                int maxPower = 750;            
                int minDamage = 150;
                int maxDamage = 200;            
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, characterClass);
                Console.WriteLine(enter);
                Console.WriteLine("힘 +{0}-{1}", minPower, maxPower);            
                Console.WriteLine("규탄으로 주는 피해 {0}-{1}% 증가 ({2} 전용)", minDamage, maxDamage, characterClass);
                Console.WriteLine(enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    7.파이로 마렐라

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "파이로 마렐라";
                string equipmentType = "보조 장비";
                eClass characterClass = eClass.Crusader;
                int minConsumption = 40;
                int maxConsumption = 50;            
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, characterClass);
                Console.WriteLine(enter);
                Console.WriteLine("방패 가격의 진노 소모량 {0}-{1}% 감소", minConsumption, maxConsumption);
                Console.WriteLine("무작위 속성 +8가지");
                Console.WriteLine(enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    8.트래그울의 똬리

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "트래그울의 똬리";
                string equipmentType = "손목";            
                int minStatus = 416;
                int maxStatus = 500;            
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);            
                Console.WriteLine(enter);
                Console.WriteLine("쐐기 덫이 관통 가시 룬의 효과 발휘 및 두 배 더 빠르게 설치됨");
                Console.WriteLine("3가지 마법 속성 중 1개(가변)");
                Console.WriteLine("  민첩 +{0}-{1}", minStatus , maxStatus);
                Console.WriteLine("  힘 +{0}-{1}", minStatus, maxStatus);
                Console.WriteLine("  지능 +{0}-{1}", minStatus, maxStatus);
                Console.WriteLine("무작위 속성 +4가지");
                Console.WriteLine(enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

     

    9.찰나의 허리끈

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "찰나의 허리끈";
                string equipmentType = "허리";            
                int minArmor = 440;
                int maxArmor = 506;
                float minAttackSpeed = 5.0f;
                float maxAttackSpeed = 7.0f;
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);            
                Console.WriteLine(enter);
                Console.WriteLine("{0}-{1}", minArmor, maxArmor);
                Console.WriteLine("방어도");
                Console.WriteLine(enter);
                Console.WriteLine("공격 속도 {0:.0}-{1:.0}% 증가", minAttackSpeed, maxAttackSpeed);
                Console.WriteLine("무작위 속성 +5가지");
                Console.WriteLine(enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

     

    10.장송곡 판금 갑옷

    using System;
    
    namespace Study00
    {
        //디아블로3 직업 열거형 선언
        enum eClass
        {
            Barbarian,
            Crusader,
            DemonHunter,
            Monk,
            WitchDoctor,
            Wizard,
            Necromancer
        }
        class Program
        {
            static void Main(string[] args)
            {
                //tab, enter 문자 상수 초기화
                const char tab = (char)9;
                const char enter = (char)10;
                //무기정보변수 초기화
                string itemName = "장송곡 판금 갑옷";
                string equipmentType = "몸통";
                eClass characterClass = eClass.Necromancer;
                int minArmor = 660;
                int maxArmor = 759;
                int minStatus = 416;
                int maxStatus = 500;
                int minEssenceAndLife = 75;
                int maxEssenceAndLife = 100;
                int requireLevel = 70;
    
                //출력
                Console.WriteLine(tab + itemName);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, equipmentType);
                Console.WriteLine("{0}{1}{2}{3}", tab, tab, tab, characterClass);
                Console.WriteLine(enter);
                Console.WriteLine("{0}-{1}", minArmor, maxArmor);
                Console.WriteLine("방어도");
                Console.WriteLine(enter);
                Console.WriteLine("지능 +{0}-{1}", minStatus, maxStatus);
                Console.WriteLine("포식이 정수 및 생명력을 추가로 {0}-{1}% 회복시킴. 포식이 \n정수 또는 생명력을 최대치 이상 회복시키면, 초과량이 3초에 \n걸쳐 회복됨", minEssenceAndLife, maxEssenceAndLife);
                Console.WriteLine("무작위 속성 +4가지");
                Console.WriteLine("빈 보석홈");
                Console.WriteLine("빈 보석홈");
                Console.WriteLine("빈 보석홈");
                Console.WriteLine(enter);
                Console.WriteLine("{0}{1}{2}요구 레벨: {3}", tab, tab, tab, requireLevel);
            }
        }
    }
    

Designed by Tistory.