본문 바로가기

전체 글

(261)
[백준] 10809 : 알파벳 찾기 JAVA 풀이 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[] alphabet = new int[26]; // 알파벳 개수의 크기만큼 배열 생성 for(int i=0;i
[백준] 11720 : 숫자의 합 JAVA 풀이 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 n = Integer.parseInt(br.readLine()); String str = br.readLine(); int sum = 0; for(int i=0;i
[백준] 11654 : 아스키 JAVA 풀이 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 str = br.readLine(); char c = str.charAt(0); System.out.printf("%d", (int)c); } } 이게 아무런 참고자료 없이 내가 짠 코드인데 여러모로 찝찝했다.. 문자열로 입력받은 뒤 문자로 변환하고 그걸 다시 ..
[백준] 8958 : OX퀴즈 JAVA 풀이 import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testcase = Integer.parseInt(br.readLine()); String str; for(int i=0;i
[백준] 4344 : 평균은 넘겠지 JAVA 풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.StringTokenizer; import java.util.List; public class Main{ public static void main(String[] main)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int C = Integer.parseInt(br.readLine()); int[] arr; StringTokenizer st; for(int i=0;i
[백준] 1546 : 평균 JAVA 풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.StringTokenizer; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); float[] score = new float[N]; float max = -1, sum = 0; StringTokenizer st = ne..
[백준] 3052 : 나머지 JAVA 풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.HashSet; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); HashSet h = new HashSet(); for(int i=0;i
[백준] 2577 : 숫자의 개수 JAVA 풀이 import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int val = Integer.parseInt(br.readLine()) * Integer.parseInt(br.readLine()) * Integer.parseInt(br.readLine()); int[] arr = new ..