본문 바로가기
반응형

전체 글552

운영체제 - 컴파일러 최적화(Release, volatile) 쓰레드를 사용할 떄 스택 메모리는 다 각자 자기만의 메모리 할당 전역 변수는 모든 쓰레들이 공통적으로 사용해서 동시 접근 가능하다. class Program { static bool _stop = false; static void ThreadMain() { Console.WriteLine("쓰레드 시작"); while(_stop == false) { // 누군가가 stop 신호를 해주기를 기다린다. } Console.WriteLine("쓰레드 종료"); } static void Main(string[] args) { Task t = new Task(ThreadMain); t.Start(); Thread.Sleep(1000); // 1초 동안 대기 _stop = true; 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.
백준 C# 2908 using System; namespace baek2 { class Program { static void Main(string[] args) { string input = Console.ReadLine(); string trim_input = input.Trim(); string[] token = trim_input.Split(); string first = token[0]; string second = token[1]; char[] first_answer = new char[3]; char[] second_answer = new char[3]; int j = 2; for(int i = 0; i int.Parse(second_answer)) { Console.WriteLine(first_answer);.. 2023. 4. 26.
백준 C# 1152 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) { string input = Console.ReadLine(); string trim_input =.. 2023. 4. 26.
백준 C# 10809 아스키코드 알아보러 가기 C# - 아스키코드(정수를 문자로, 문자를 정수로) 0. 아스키코드 표 출처 : https://www.asciitable.com/ 1. Char to Int 01 int형으로 캐스팅 string input = Console.ReadLine(); char asc_c = input[0]; int asc_i = (int)asc_c; Console.WriteLine(asc_i); 02 Convert.ToInt32 메서드 string input = Con code-piggy.tistory.com using System; namespace baek2 { class Program { static void Main(string[] args) { string input = Console.Read.. 2023. 4. 26.
반응형