C#/수업 내용

2021-08-16

JSH1 2021. 8. 16. 16:10

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

namespace hello_world
{
    class Program
    {
        static void Main(string[] args)
        {
            string item_name = "HARLEQUIN CREST";
            string grade = "Magic";
            string sub_category = "Helm";
            int min_armor = 21;
            int max_armor = 24;
            string category = "Armor";
            string option = "+3 Random Magic Properties";

            Console.WriteLine(item_name + "\n" + grade + "\n" + sub_category);
            Console.WriteLine(min_armor + "\n" + max_armor);
            Console.WriteLine(category + "\n" + option);
        }
    }
}


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

namespace hello_world
{
    class Program
    {
        static void Main(string[] args)
        {
            float min_damage = 2;
            float max_damage = 3;
            float attacks_per_second = 1.2f;

            float average_damage = (min_damage + max_damage) / 2 * attacks_per_second;

            Console.WriteLine(String.Format("{0:0.0}", average_damage) + " Damage Per Second");
        }
    }
}



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

namespace hello_world
{
    class Program
    {
        static void Main(string[] args)
        {
            int blacksmithLevel = 1;
            string description = "Blacksmith (Level {0})";
            Console.WriteLine(description, blacksmithLevel);

            int magicCount = 7;
            description = "One of {0} Magic Properties (varies)";
            Console.WriteLine(description, magicCount);

            int minBleedChance = 34;
            int maxBleedChance = 39;
            description = "[{0} - {1}]% chance to inflict Bleed";
            Console.WriteLine(description, minBleedChance, maxBleedChance);

            int gainDamage = 39;
            description = "You gain {0}% damage";
            Console.WriteLine(description, gainDamage);

            int setCount = 2;
            int life = 2;
            int experience = 20;
            description = "({0}) Set \n+{1}% Life \n+{2}% Experience.";
            Console.WriteLine(description, setCount, life, experience);

            int value = 2;
            int level = 70;
            description = "({0}% at level {1})";
            Console.WriteLine(description, value, level);
        }
    }
}

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

[C#] ConsoleKeyInfo, 키 입력  (0) 2021.08.18
2021-08-18 오전  (0) 2021.08.18
2021-08-17 2  (0) 2021.08.17
[C#] enum사용  (0) 2021.08.17
2021-08-17  (0) 2021.08.17