본문 바로가기

분류 전체보기274

[BOJ C#] 5585 거스름돈 using System; namespace _5585 { class Program { static void Main() { int price = int.Parse(Console.ReadLine()); int charge = 1000 - price; int count = 0; while (charge > 0) { if (charge >= 500) { count += (charge / 500); charge %= 500; } else if (charge >= 100) { count += (charge / 100); charge %= 100; } else if (charge >= 50) { count += (charge / 50); charge %= 50; } else if (charge >= 10) { co.. 2023. 1. 27.
[BOJ C#] 1259 팰린드롬수 using System; using System.Linq; using System.Text; using System.IO; namespace _1259 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); StringBuilder sb = new StringBuilder(); while (true) { string str = sr.ReadLine(); if (str == "0") break; string strReverse = new string(str.Re.. 2023. 1. 26.
[ C# ] 인벤토리 구현 App Class using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace cshNHR { class App { //생성자 public App() { Inventory inventory = new Inventory(2); inventory.AddItem(new Weapon("장검")); inventory.AddItem(new Weapon("장검")); inventory.AddItem(new Weapon("단검")); inventory.AddItem(new Weapon("창")); inventory.AddItem(new Armor("가죽옷".. 2023. 1. 26.
[BOJ C#] 1085 직사각형에서 탈출 using System; using System.IO; namespace _1085 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); string[] arrString = sr.ReadLine().Split(' '); int x = int.Parse(arrString[0]); int y = int.Parse(arrString[1]); int w = int.Parse(arrString[2]); int h = int.Parse(arrString[3]); in.. 2023. 1. 25.
[BOJ C#] 4153 직각삼각형 using System; using System.Collections.Generic; using System.Text; using System.IO; namespace _4153 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); StringBuilder sb = new StringBuilder(); List arr = new List(); while(true) { string[] arrString = sr.ReadLine().Split(' '); int .. 2023. 1. 25.
[BOJ C#] 10250 ACM 호텔 using System; using System.Text; using System.IO; namespace _10250 { class Program { static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); StringBuilder sb = new StringBuilder(); int data = int.Parse(sr.ReadLine()); while (data > 0) { string[] arr = sr.ReadLine().Split(' '); int h = int.Parse(arr[0].. 2023. 1. 25.