본문 바로가기
반응형

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

백준 C# - 25206 소수점 자릿수 알아보기 2023. 5. 15.
백준 C# - 1316 StringBuilder 알아보러 가기 C# - StringBuilder String String 개체는 변경할 수 없다. System.String 클래스에서 메서드 중 하나를 사용할 때마다 메모리에 새 문자열 개체가 생성되므로, 새 개체에 대한 공간을 새로 할당 되어진다. 그러므로 문자열 code-piggy.tistory.com using System; using System.Collections.Generic; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int count = 0; while (n>0) { n--; bool.. 2023. 5. 15.
백준 C# - 2941 StringBuilder 알아보러 가기 C# - StringBuilder String String 개체는 변경할 수 없다. System.String 클래스에서 메서드 중 하나를 사용할 때마다 메모리에 새 문자열 개체가 생성되므로, 새 개체에 대한 공간을 새로 할당 되어진다. 그러므로 문자열 code-piggy.tistory.com using System; using System.Collections.Generic; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { string s1 = Console.ReadLine(); StringBuilder sb = new StringBuilder(s1); str.. 2023. 5. 15.
백준 C# - 4344 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { string c_string = Console.ReadLine(); int c = int.Parse(c_string); while(c>0) { string n_string = Console.ReadLine(); string[] token = n_string.Split(); int n = int.Parse(token[0]); int[] students = new int[n]; int total = 0; for(int i = 1; i (.. 2023. 5. 13.
백준 C# 1157 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { string input = Console.ReadLine(); string lower_input = input.ToUpper(); char[] arr = lower_input.ToArray(); Dictionary pig = new Dictionary(); for (int i = 0; i < input.Length; i++) { if (pig.ContainsKey(arr[i])) { pig[arr[i]] += 1; } else { p.. 2023. 5. 8.
백준 C# 10988 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { string input = Console.ReadLine(); int answer = 1; char[] string_1 = new char[input.Length]; char[] string_2 = new char[input.Length]; for (int i = 0; i < input.Length; i++) { string_1[i] = input[i]; } int count = 0; for(int i = input.Length; i.. 2023. 5. 8.
반응형