반응형 코딩테스트 준비/백준 C#161 백준 C# 2743 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; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(s.. 2023. 4. 21. 백준 C# 27866 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; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main.. 2023. 4. 21. 백준 C# 1546 List메서드 알아보러 가기 C# - List 메서드 List를 사용하기 위해서는 System.Collections.Generic 네임스페이스를 추가해줘야한다. using System.Collections.Generic; List pig = new List(); 1. Add List 끝 부분에 추가 public void Add (T item); List pig = new List(); pig.Add(2); code-piggy.tistory.com using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(string[] .. 2023. 4. 21. 백준 C# 10811 List 메서드 알아보러 가기 C# - List 메서드 List를 사용하기 위해서는 System.Collections.Generic 네임스페이스를 추가해줘야한다. using System.Collections.Generic; List pig = new List(); 1. Add List 끝 부분에 추가 public void Add (T item); List pig = new List(); pig.Add(2); code-piggy.tistory.com using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace baek2 { class Program { static void Main(string[].. 2023. 4. 18. 백준 C# 3052 List 중복된 값 제거하는 법 알아보러 가기 C# - 중복된 값 제거하 1. Contains을 사용하기 foreach(int i in list) { if (answer.Contains(i)) continue; answer.Add(i); } 2. Distinct 메서드 사용하기 Distnict 메서드는 System.Linq 네임스페이스에 있으므로 using문에 System.Linq를 추가한다. using S code-piggy.tistory.com using System; using System.Collections.Generic; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { List list .. 2023. 4. 18. 백준 C# 5597 List 메서드 알아보러 가기 C# - List 메서드 List를 사용하기 위해서는 System.Collections.Generic 네임스페이스를 추가해줘야한다. using System.Collections.Generic; List pig = new List(); 1. Add List 끝 부분에 추가 public void Add (T item); List pig = new List(); pig.Add(2); code-piggy.tistory.com using System; using System.Collections.Generic; using System.Text; namespace baek2 { class Program { static void Main(string[] args) { List list .. 2023. 4. 12. 이전 1 ··· 18 19 20 21 22 23 24 ··· 27 다음 반응형