소수 구하기 11을 소수판별 하기 위해서는 2에서 11의 제곱근까지만 확인해보면 된다. ★ 49와 같이 n^2 의 경우 제곱근 7까지 탐색 for ( int i=2; i*i
분류 전체보기
1-1. Git Repo 복사하여 Local에 가져오기 git clone https://github.com/{User_Name}/{Repo_Name}.git 1-2. Local에서 Git 시작하기 git init 2. Local Repo에 추가 ( 임시저장 ) git add README.md git add . 3. Local Repo에 Commit (저장) git commit -m "first commit" 4. Remote Git 경로 저장 git remote add origin https://github.com/{User_Name}/{Repo_Name}.git 4-1. Remote 저장정보 확인 ( ※작성중 ) cd ./git 5. Git Push git push -u origin master
1. Virtualenv 설치 $ pip install virtualenv 2. Virtualenv 생성 $ cd /project_dir $ virtualenv myenv 2-1. 특정 Python Version 활용하여 Virtualenv 생성 $ virtualenv venv --python=python3.7 3. Virtualenv 활성화 / 비활성화 [ LINUX ] $ source ./myenv/bin/activate or decativate [WINDOWS] $ ./myenv/Scripts/activate or deactivate
자주 사용하는 단축키 정리 Ctrl + F11 : 실행 Ctrl + S : 파일 저장 및 컴파일 Ctrl + D : 1줄삭제 Ctrl + O : 마지막 편집위치로 이동 Ctrl + . : 다음 오류로 이동 Ctrl + , : 이전 오류로 이동 Ctrl + Alt + ↑↓ : 한줄 위/아래 로 복사 Alt + ↑↓ : 한줄 위/아래 로 이동 Ctrl + Shift + L : 단축기 Hint Ctrl + Shift + O : 자동으로 Import 시키기 Ctrl + Shift + F : 코드 자동정리 Ctrl + Shift + S : 열려있는 모든 파일 저장 Ctrl + Shift + / : Block 설정 Ctrl + Shift + \ : Block 설정 제거
substring(int start, int end) - String 자르기 charAt(int index) import java.util.Stack; public class Solution { public static void main(String[] args) { String word = "ABCDEFG"; String sub_word; // substring() sub_word = word.substring(3); // "DEFG" sub_word = word.substring(1,word.length()); // "BCDEFG" sub_word = word.substring(0,word.length()-1); // "ABCDEF" // charAt() char A = word.charAt(0); ..
Class를 활용한 구조체 생성 (Value) PriorityQueue Custom 정렬을 위해서 compareTo 활용. compareTo 하지 않을경우 Error 발생 ( default int 정렬 ) import java.util.*; class Value implements Comparable{ private int start,time; public Value(int start, int time){ this.start = start; this.time = time; } public int getTime(){ return this.time; } public int getStart(){ return this.start; } @Override public int compareTo(Value target..