백준15 [JAVA][백준] 1181_단어정렬 (Comparator) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; public class sortingWord_1181 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] arr = new String[n]; for (int i = .. 2024. 4. 18. [JAVA][백준] 10989_수 정렬하기 3 (BufferedReader) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class sorting3_10989 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int n = Integer.parseInt(br.readLine()); int[] arr = new int[n]; for (int i.. 2024. 4. 16. [JAVA][백준] 1978_소수 찾기 1. 기본 풀이 import java.util.Scanner; public class primeNum_1978 { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); int[] num = new int[n]; for (int i = 0; i < n; i++) { num[i] = sc.nextInt(); } int res = 0; for (int i = 0; i < n; i++) { int j; for (j = 2; j < num[i]; j++) { if (num[i] % j == 0) { break; } } if (num[i] == j) { res++.. 2024. 4. 15. [JAVA][백준] 10809_알파벳 import java.util.Scanner; public class Zalphbet_10809 { public static void main (String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); int[] alph = new int[26]; for (int a = 0; a < 26; a++) { alph[a] = a+101; } for (int b = 0; b < str.length(); b++) { char tmp = str.charAt(b); for (int k = 0; k < 26; k++) { if ((tmp+4) == alph[k]) { alph[k] = b; } } } for (int c = 0; .. 2024. 4. 15. 이전 1 2 3 4 다음