목록CSE (86)
한 걸음 두 걸음
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = 0 ; int b; char op; int count = 0; int result = 0; while(sc.hasNext()) { if(count == 0) a = sc.nextInt(); else a = result; op = sc.next().charAt(0); if(op == '=') break; b = sc.nextInt(); result = calc(a,op,b); count++; } System.out.println(result); } public ..
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[][] n = new int[3][4]; int[] result = new int[3]; for(int i = 0 ; i < 3; i ++) for(int j = 0 ; j < 4; j++) { n[i][j] = sc.nextInt(); result[i] += n[i][j];} for(int i = 0 ; i < 3; i ++) { switch(result[i]) { case 0: System.out.println("D"); break; case 1: System.out.print..
/* * 1 = 2 * 2 = 4 * 3 = 6 * 4 = 8 * 5 = 10 * ... * 10 = 11 * 11 = 13 * 13 = 17 * ... * 5000 = 5005 * ... * 9950 = 9973 * 9951 = 9974 * ... * 9972 = 9999 * * */ public class Main { public static void main(String[] args){ int[] arr = new int[10000];//0으로 초기화 for(int i = 1; i
백준 12096페이지의 html코드를 읽어옵니다. 주석처리된 부분을 읽어 https://www.base64decode.org/ 에서 base64코드를 입력하고 해독된 코드(한국어)를 읽어 힌트를 얻으시면 됩니다.
import java.util.Comparator; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String empty = sc.nextLine(); String[] book = new String[n]; TreeMap map = new TreeMap(); for(int i = 0 ; i < n ; i ++) {..
import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; import java.util.StringTokenizer; import java.util.TreeMap; public class Main { public static void main(String[] args){ Map googleEntry = new TreeMap(Collections.reverseOrder()); Scanner sc = new Scanner(System.in); int testCase = sc.nextInt(); String what = sc.nextLine(); String[] tokenStr ..
맵(Map)이란? 맵은 mapping의 약자로 ("Key","Value")값으로 구성되어있습니다. 맵 클래스 종류 Map 인터페이스 중 가장 많이 쓰이는 맵클래스는 HashMap, TreeMap, LinkedHashMap이며, HashMap은 null값을 저장할 때, HashTable은 멀티스레드 환경에서 사용됩니다. 맵 자료구조 사용하기 Map map = new HashMap(); HashMap map = new HashMap(); put map.put("key","value"); // key&value값 초기화됨 get map.get("key"); //value값 반환됨 hashMap에 대한 구체적인 사용방법 링크 https://vaert.tistory.com/107 참고URL Collection에 ..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); String A = String.valueOf(a); String B = String.valueOf(b); A = A.replace("5", "6"); B = B.replace("5", "6"); //System.out.println("1 :"+A +" "+B); int maxSum = Integer.parseInt(A) + Integer.parseInt(B); int minSum; A = A.replace(..