본문 바로가기
반응형

백준알고리즘35

백준 2744번 대소문자 바꾸기 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class bj2744 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String st = br.readLine(); char c[] = st.toCharArray(); for(int i=0; i=(int)'a'){ c[i] = (char)(a-32); } else{ c[i] = (char)(a+32); } System.out.print.. 2023. 1. 6.
[Java][정렬][그리디 알고리즘] 백준 1931 회의실 배정 package codinginterview; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; public class BJ1931 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokeniz.. 2021. 5. 2.
[Java][그리디 알고리즘] 백준 2217 로프 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)); int n = Integer.parseInt(br.readLine()); int[] rope = new int[n]; int[] ans = new int[n]; for(int i=0; i 2021. 5. 2.
[Java][그리디 알고리즘] 백준 11047 동전 0 package codinginterview; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BJ11047 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.next.. 2021. 4. 28.
반응형