본문 바로가기
반응형

코딩테스트 준비/백준 C#161

백준 C# 10812 +) 풀이 1. 예제 입력으로 예시 01 바구니 만들기 N이 10이므로 1부터 N까지 번호가 적혀있는 바구니를 만들어 준다. int[] array = new int[n]; for(int i = 0; i mid, mid+1, ..., end-1, end, begin, begin+1, ..., mid-1로 회전 01 left - w이전의 값들이다. Array의 크기는 w-1이다. int[] left = new int[w - 1]; 위의 array에서 0부터 w-1크기만큼 Copy한다. Array.Copy(array, 0, left, 0, w - 1); Copy의 결과는 빈 배열이 나온다. 04 leftmid - begin -> mid에서 바뀌는 부분부터 end까지 Array의 크기는 y-z-+1 이다. z가 포함되어야.. 2023. 5. 3.
백준 C# 2444 String Builder 알아보러가기 C# - StringBuilder String String 개체는 변경할 수 없다. System.String 클래스에서 메서드 중 하나를 사용할 때마다 메모리에 새 문자열 개체가 생성되므로, 새 개체에 대한 공간을 새로 할당 되어진다. 그러므로 문자열 code-piggy.tistory.com List 메소드 알아보러가기 C# - List (찾기, 추가, 제거, 정렬 메서드) List를 사용하기 위해서는 System.Collections.Generic 네임스페이스를 추가해줘야한다. using System.Collections.Generic; List pig = new List(); 1. Add List 끝 부분에 추가 public void Add (T item); L.. 2023. 4. 28.
백준 C# 3003 using System; namespace baek2 { class Program { static void Main(string[] args) { int[] number = { 1, 1, 2, 2, 2, 8 }; string input = Console.ReadLine(); string[] token = input.Split(); int[] dong = new int[6]; int[] answer = new int[6]; for(int i = 0; i 2023. 4. 27.
백준 C# 25083 using System; namespace baek2 { class Program { static void Main(string[] args) { Console.WriteLine(" ,r'\"7"); Console.WriteLine("r`-_ ,' ,/"); Console.WriteLine(" \\. \". L_r'"); Console.WriteLine(" `~\\/"); Console.WriteLine(" |"); Console.WriteLine(" |"); } } } 2023. 4. 27.
백준 C# 11718 String 메서드 알아보러 가기 C# - String (찾기, 변형, 분할, 제거 메서드) 1. 찾기 01 Contains 특정 문자열이 문자열안에 있는지 확인 public bool Contains (string value); 반환 Boolean : 문자열이 있으면 true 없으면 false 를 반환한다. string name = "Pink Pig"; bool found = name.Contains("Pink"); Con code-piggy.tistory.com using System; namespace baek2 { class Program { static void Main(string[] args) { while (true) { string input = Console.ReadLine(); Cons.. 2023. 4. 26.
백준 C# 5622 using System; namespace baek2 { class Program { static void Main(string[] args) { string input = Console.ReadLine(); int count = 0; for(int i =0; i 2023. 4. 26.
반응형