목록분류 전체보기 (159)
할껀하고놀자
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer..
포인트 : Stringbuffer 를 사용. 배열을 정렬한 다음 -> reverse() 함수를 이용하여 쉽게 풀었다..! import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String []num = br.readLine().split(..
package for문연습; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); int count = num; for (int i = 0; i < num; i++) { String s = br.readLine(); String [] sp = s...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String sp = br.readLine(); String [] arr = {"c=","c-","dz=","d-","lj","nj","s=","z="}; for (int i = 0; i < arr.length; i++) { sp = sp.replace(arr[i], "..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String [] sp = br.readLine().split(""); int [] arr= {3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,10}; int result = 0; for (int i = 0; i < sp.l..
문자열을 뒤집고자 할 때 팁 : java 언어 이용 시. Stringbuffer 사용하여 reverse().tostring() 사용하기. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String [] input = br.readLine().split(" "); int n1 = Integer.parseInt(new ..
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 package ssafy0401; import java.util.Scanner; public class sol15649 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int [] arr = new int [N]; for (int i = 0; i < arr.length; i++) { arr[i] = i+1; } int [] output = new int[..
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 package ssafy0401; import java.util.Scanner; public class sol15649 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int [] arr = new int [N]; 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 import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class sol1759 { static char [] arr; static boolean [] visited; static int N; static int M; public stati..
12345678910111213141516171819202122232425262728293031323334353637383940414243444546import java.util.Scanner; public class Main { static int min = Integer.MAX_VALUE; static boolean [] visited; // 배열 탐색하는 것. static int start = 0; // 시작점. static int [][] arr; static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); arr= new int [n][n]; for (int i..