전체 글
-
boj)5904 - Moo 게임PS/boj 2020. 11. 15. 13:00
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 import java.util.Scanner; public class boj_5904 { static Scanner sc = new Scanner(System.in); static int[] dp = new int[30]; public static void main(String[] args) { int N = sc.nextInt(); dp[0] = 3; for (int i = 1; i
-
8. Array APIsJavaScript & TypeScript 2020. 11. 14. 14:24
Quiz // Q1. make a string out of an array const fruits = ['apple', 'banana', 'orange']; const result = fruits.join(); console.log(result); // 'apple,banana,orange' // Q2. make an array out of a string const fruits = '🍎, 🥝, 🍌, 🍒'; const result = fruits.split(','); console.log(result); // ["🍎", " 🥝", " 🍌", " 🍒"] // Q3. make this array look like this: [5, 4, 3, 2, 1] const array = [1, 2, 3, 4, 5]; ..
-
7. Array, APIJavaScript & TypeScript 2020. 11. 14. 14:17
Array 1. Declaration const arr1 = new Array(); const arr2 = [1, 2]; 2. Index position const fruits = ['apple', 'banana']; console.log(fruits); // 'apple', 'banana' console.log(fruits.length); // 2 console.log(fruits[0]); // 'apple' console.log(fruits[1]); // 'banana' console.log(fruits[2]); // undefined console.log(fruits[fruits.length - 1]); // 'banana' 3. Looping over an array print all fruits..
-
6. what is objectJavaScript & TypeScript 2020. 11. 14. 12:31
Objects one of the JavaScript's data types a collection of related data and/or functionality Nearly all objects in JavaScript are instances Object object = { key : value }; 1. Literals and properties const obj1 = {}; // 'object literal' syntax const obj2 = new Object(); // 'object constructor' syntax function print(person) { console.log(person.name); console.log(person.age); } const ellie = {nam..
-
boj)2447 - 별 찍기 - 10PS/boj 2020. 11. 14. 12:15
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 59 60 61 62 63 64 import java.io.*; import java.util.Scanner; public class boj_2447 { static char[][] map; static int length; static Scanner sc = new Scanner(System.in); static BufferedWriter bw = new BufferedWriter(new OutputStreamW..
-
boj)16505 - 별PS/boj 2020. 11. 14. 11:27
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 import java.io.*; import java.util.Scanner; public class boj_16505 { static char[][] map; static int N, length; static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws IOException { Scanner sc ..
-
5. class vs objectJavaScript & TypeScript 2020. 11. 14. 11:06
class template declare once no data in introduced in ES6 syntactical sugar over prototype-based inheritance 1. class declarations class Person { // constructor constructor (name, age) { // fields this.name = name; this.age = age; } // methods speak() { console.log(`${this.name}: hello! `); } } const ellie = new Person('ellie', 20); console.log(ellie.name); // ellie console.log(ellie.age); // 20 ..
-
4. Arrow FunctionJavaScript & TypeScript 2020. 11. 13. 18:04
Function fundamental building block in the program subprogram can be used multiple times performs a task or calculates a value 1. Function declaration function name(param1, param2) { body ... return; } one function === one thing naming: doSomething, command, verb e.g.createCardAndPoint ->. createCard, createPoint function is object in JS function printHello() { console.log('Hello'); } printHello..