Programming
-
[c++] Visual Studio Code c++ 설정Programming/c++ 2022. 6. 26. 23:19
visual studio code에서 c/c++ 코드를 작성하기 위해 필요한 환경 설정 및 파일들을 포스팅하겠습니다~ 1. c/c++확장 프로그램 설치 visual studio code의 extension 항목에서 c/c++확장 프로그램을 설치합니다. 2. gcc/g++ 설치 여기까지 설정했다고 c/c++ 로 디버깅과 컴파일은 할 수 없습니다. 윈도우에서 c/c++컴파일러인 gcc와 g++를 설치해야 합니다. https://sourceforge.net/projects/mingw-w64/ MinGW-w64 - for 32 and 64 bit Windows Download MinGW-w64 - for 32 and 64 bit Windows for free. A complete runtime environme..
-
[c++] isdigit() 함수Programming/c++ 2022. 5. 28. 16:24
isdigit 함수 : 매개변수 값이 숫자인지 검사 알파벳인지, 숫자인지 검사할 때 유용한 함수입니다. 1. isdigit 함수 헤더 파일 #include // c언어 #include // c++ 2. 함수 원형 int isdigit(int c); 함수의 인자(argument)로는 int형 한개를 넘겨받습니다. 3. return 값(반환 값) - FALSE : 0 - TRUE : 0이 아닌 값 4. 예제 int main() { string str = "ABCDEFG123456"; // for (auto s : str) { cout
-
[Python] 파이썬 순열과 조합Programming/Python 2022. 5. 17. 17:21
* 순열 : 서로 다른 n개에서 서로 다른 r개를 선택하여 일렬로 나열 {'A', 'B', 'C'}에서 3개를 선택하여 나열하는 경우 -> 'ABC', 'ACB', 'BAC', BCA', 'CAB', 'CBA' 순열의 수 : nPr = n * (n-1)*(n-2)* ... * (n-r+1) * 조합 : 서로 다른 n개에서 순서에 상관 없이 서로 다른 r개를 선택 {'A', 'B', 'C'}에서 순서를 고려하지 않고 두 개 선택하는 경우 -> 'AB', 'AC', 'BC' 조합의 수 : nCr = ( n*(n-1)*(n-2)* ... * (n-r+1) ) / r! 1. 순열 - 순서 o #순열 from itertools import permutations data = ['A', 'B', 'C'] resul..
-
[Python] 파이썬 자주 사용되는 라이브러리Programming/Python 2022. 5. 17. 17:10
* 내장 함수 : 기본 입출력 함수부터 정렬 함수까지 기본적인 함수 제공 - 파이썬 프로그램에서 필수적인 기능 포함 * itertools : 파이썬에서 반복되는 형태의 데이터를 처리하기 위한 유용한 기능 제공 - 순열과 조합 라이브러리는 코딩 테스트에 자주 사용됨 * heap : 힙(Heap) 자료구조를 제공 - 일반적으로 우선순위 큐 기능을 구현하기 위해 사용 * bisect : 이진 탐색(Binary Search) 기능 제공 * Collections : deque, counter 등의 자료 구조 포함 * math : 필수적인 수학적 기능 제공 - 펙토리얼, 제곱근, 최대공약수(GCD), 삼각함수 관련 함수부터 Pi와 같은 상수 포함 1. 자주 사용되는 내장 함수 1-1. sum( ) #sum() re..
-
[Python] 파이썬 기초 3 (반복문)Programming/Python 2022. 5. 17. 17:02
1. while 문 #반복문------------------------------------------------ #while y = 0 while y < 5: print(y) y =y +1 2. for 문 #for문 #for 변수 in 리스트 : array = [9,8,7,6,5] #리스트 for x in array: print(x) array = (1,2,3,4,5) #튜플 for x in array: print(x) #range(시작 값, 끝 값+1) #i = 1~9 까지 의 수 result = 0 for i in range(1, 10): print(result+i) 3. continue #특정 번호의 학생은 제외하기 scores = [90, 85, 77, 65, 97] cheating_studen..
-
[Python] 파이썬 기초 2 (입출력, 조건문, pass)Programming/Python 2022. 5. 17. 17:00
1. 입출력 #입출력--------------------------------------- n = int(input()) print(n) #공백 기준으로 한번에 입력 받기 input_data = input().split() print(input_data) #string형으로 저장됨 #map함수로 int형으로 포맷하여 저장 input_data2 = map(int, input().split()) print(input_data2) #map object 주소가 나옴 # map함수로 int형으로 포맷하여 list에 저장 input_data3 = list(map(int, input().split())) print(input_data3) 1-1. 더 빠른 방법: #sys.stdin.readline() 메서드 이용 #..
-
[Python] 파이썬 기초 1 (리스트, 튜플, 사전자료형, 집합자료형)Programming/Python 2022. 5. 17. 16:55
1. 리스트 b = ["a", "b", 1, 2] print(b) print('\n') 2. 튜플 #튜플------------------------------------------ a = (1,2,3,4) print(a) print('\n') 3. 사전자료형 : dic() #사전 자료형-------------------------------------- data = dict() data['사과'] = 'Apple' data['바나나'] = 'banana' data['코코넛'] = 'Coconut' print(data) print('\n') #초기화 방법2 b = { '홍길동' : 97, '이순신' : 98 } print(b) print('\n') if '사과' in data: print('사과 존재!!'..
-
[Windows] 윈도우10 설치 - 부팅 usb 만들기Programming/Setup 2022. 3. 28. 10:47
윈도우 10 설치하기 위해 필요한 부팅 usb 만드는 방법을 포스팅해보겠습니다~ 1. usb 준비 -USB 드라이브 혹은 이동 디스크가 인식되었는지 확인합니다. 2. usb 포맷 1) USB 드라이브에 "우클릭>포맷" 을 클릭합니다. 2) 저는 파일 시스템을 'NTFS' 형태로 포맷하겠습니다. 3. Microsoft에서 도구 다운로드 https://www.microsoft.com/ko-kr/software-download/windows10 Windows 10 다운로드 Windows 10용 ISO 파일을 다운로드한 경우, 해당 파일은 선택한 위치에 로컬로 저장됩니다.컴퓨터에 타사 DVD 굽기 프로그램이 설치되어 있으며 해당 프로그램을 사용하여 설치 DVD를 만들려는 경우, www.microsoft.com ..