최's 먹공로그
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 package backjoon; import java.util.Scanner; /** * 알고리즘 경우의 수 부분집합 게시글 참고!! */ public class b1182 { static int cnt = 0; public static void sum(int[] arr, int[] arr_index, int size, int N, int S, int index) { int sum = 0; for (int i = 0; i
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 package backjoon; import java.util.Scanner; public class b1018 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.next..
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 65 66 67 68 69 70 71 72 73 74 package org.opentutorials.javatutorials.switch_statement; public class switch_statement { public static void main(String[] args) { System.out.println("switch(1)"); switch(1){ case 1: Sy..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 package org.opentutorials.javatutorials.string; public class string { public static void main(String[] args) { System.out.println('생'); // ' 작은 따옴표는 문자! System.out.println("생홡코딩"); // " 큰 따옴표는 문자열! // System.out.println('생활코딩'); 문자열은 ' 작은 따옴표로 안됨! System.out.println("생"); // 문자는 " 큰 따옴표도 가능! System.out.println("egoing said \"Welcome\""); // \를 앞에 붙여주면 ' ..
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 package org.opentutorials.javatutorials.operator; public class operator { public static void main(String[] args) { // 연산자 int result = 1+2; System.out.println(result); result = result - 1; System.out.println(result); result = result * 2; System.out.pr..
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 package org.opentutorials.javatutorials.if_statement; public class if_statement { public static void main(String[] args) { if(false) { System.out.println("result : true"); } else { System.out.println("result : false"); } if(false) { System.out.println(1); System.out.println(2); System.o..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 package org.opentutorials.javatutorials.constant; public class constant { public static void main(String[] args) { float a=2.2; // 오류발생 float b=2.2F; // float 사용 double c = 2.2; // 기본적으로 소수점은 double int d = 2147483648; // int의 범위 초과 long e = 2147483648; // 오류발생 long f = 2147483648L; // long 사용 byte g = 100; short h = 200; } } Colored by Color Scrip..