본문 바로가기

전체 글50

JavaScript(1) - 스크립트 언어 : 어떤 어플리케이션에서 그 코드를 해석하고 실행할 수 있는 엔진이 존재하여 그 스크립트로 해당 어플리케이션을 제어하기 위한 용도로 사용되는 프로그래밍 언어 - 인터프리터 언어 : 소스코드를 한 줄씩 읽으면서 해석 - 다양한 런타임 환경 : 각종 웹브라우저, Node,js, Electron 등 자바스크립트는 많은 분야(웹 프론트엔드, 백엔드, 데스크탑, 모바일 등)에서 사용된다. 실습 준비 1. chrome 2. node.js 3. vscode vscode로 코드를 작성한 후 cmd를 통해 코드가 작성된 파일이 있는 폴더로 가서 node 파일명.js 을 입력하면 명령이 실행된다. 표현식(Expression) : 값을 만들어내는 간단한 코드를 표현식이라고 한다. ex) true, fals.. 2020. 2. 4.
error: cannot find symbol @RunWith(SpringRunner.class) 해결 방법 해결 방법 : build.gradle 파일의 implementation 항목에 'junit:junit:4.12' 을 추가하면 해결된다. 2020. 1. 23.
3456. 직사각형 길이 찾기 t = int(input()) for q in range(t): a, b, c = map(int,input().split()) if a == b : ans = c elif a == c : ans = b else : ans = a print('#%d'%(q+1),ans) 2019. 9. 29.
2805. 농작물 수확하기 import copy t = int(input()) for q in range(t): n = int(input()) arr = [] for i in range(n): arr.append(list(input())) half = int(n/2) row = copy.deepcopy(half) row_end = copy.deepcopy(half) sw = 0 ans = 0 if n == 1: print('#%d'%(q + 1), arr[0][0]) continue for i in range(n): for j in range(row,row_end+1): ans = ans + int(arr[i][j]) if sw == 0 : row -= 1 row_end += 1 if row_end == n - 1: sw = 1 .. 2019. 9. 29.
1228. [S/W 문제해결 기본] 8일차 - 암호문1 import copy for t in range(10): lenn = int(input()) # 원본 암호문 길이 text = list(map(str,input().split())) # 원본 암호문 inst_n = int(input()) # 명령어 개수 inst = list(map(str,input().split())) # 명령어 x = int(inst[1]) # x의 자리에 y = int(inst[2]) # y개의 숫자 삽입 inst_index = 3 # 숫자 now = 3 # 다음 반복문을 가리킴 for i in range(inst_n): for j in range(y): text.insert(x,inst[inst_index]) # 숫자 추가 x = x + 1 # 다음 자리 지정 inst_index .. 2019. 9. 29.
1240. [S/W 문제해결 응용] 1일차 - 단순 2진 암호코드 import copy t = int(input()) code = ['0001101','0011001','0010011','0111101','0100011','0110001','0101111','0111011','0110111','0001011'] for q in range(t): n,m = map(int,input().split()) arr = [] ans = '' for i in range(n): # 배열 입력 arr.append(input()) for i in range(0,n): # 1 찾기 if arr[i].find('1') >= 0: found_arr = copy.deepcopy(arr[i]) break; for i in range(m-1,0,-1): #뒤에서 부터 1찾기 if found_arr.. 2019. 9. 28.