전체 글
-
3. operator, if, for loopJavaScript & TypeScript 2020. 11. 13. 17:40
1. String concatenation console.log('my' + ' cat'); // my cat console.log('1' + 2); // 12 console.log(`string literals: 1 + 2 = ${1 + 2}`); // 1 + 2 = 3 2. Numeric operators console.log(1 + 1); // add : 2 console.log(1 - 1); // substract : 0 console.log(1 / 1); // divide : 1 console.log(1 * 1); // multiply : 1 console.log(5 % 2); // remainder : 1 console.log(2 ** 3); // exponentiation : 8 3. Inc..
-
2. data types, let vs var, hoistingJavaScript & TypeScript 2020. 11. 13. 17:21
1. let vs var, hoisting Variable, rw(read/write) let (added in ES6) scope global scope block scope Var var (don't ever ues this) var hoisting (move declaration from bottom to top) has no block scope block scope ignore Constant, r (read only) favor immutable data type always for a few reasons security thread safety reduce human mistakes 2. data types Variable types primitive, single item number s..
-
1. script async vs deferJavaScript & TypeScript 2020. 11. 13. 16:56
1. async vs defer - head - js 파일 사이즈가 크고 인터넷이 느리면 사용자가 웹사이트를 보는데 시간이 많이걸린다. - body - js에 의존적이라면 js가 실행될때까지 기다려야한다. - head + async - js에서 html 부분을 다루려고 할때 parsing 되어있지 않으면 문제가 생기고 시간이 좀 걸린다. - head + async - js가 순서에 의존적이라면 문제가 될 수 있음 - head + defer - 가장 좋은 옵션 - use strict Whole-script strict mode syntax JavaScript is very flexible flexible == dangerous added ECMAScript 5 'use strict' ※출처 www.yout..
-
boj)1992 - 쿼드트리PS/boj 2020. 11. 13. 16:21
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 import java.io.*; public class boj_1992 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringBuilder sb = new StringBuilder(); static int[][] map; static int N; public static void main(String[] ar..
-
boj)1780 - 종이의 개수PS/boj 2020. 11. 13. 14:57
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 import java.io.*; import java.util.*; public class boj_1780 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int N; static int[] cnt; static int[][] map; public stat..
-
boj)17478 - 재귀함수가 뭔가요?PS/boj 2020. 11. 12. 14:05
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 import java.util.Scanner; public class boj_17478 { static StringBuilder sb = new StringBuilder(); static String base = "어느 한 컴퓨터공학과 학생이 유명한 교수님을 찾아가 물었다."; static String str = "\"재귀함수가 뭔가요?\""; static String str2 = "\"잘 들어보게. 옛날옛날 한 산 꼭대기에 이세..
-
boj)1074 - ZPS/boj 2020. 11. 12. 13:19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 import java.io.*; import java.util.*; public class boj_1074 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int n, r, c; public static void main(String[] args) throws IOException { StringTokenizer st = new StringTokenizer(br.readLine()); n = Intege..
-
boj)11729 - 하노이 탑 이동 순서PS/boj 2020. 11. 11. 18:37
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import java.io.*; public class boj_11729 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException { int n = Integer.parseInt(br.readLine()); hanoi(1, 3, n); System.out.println((int) (Math.pow(2, n) ..