[백준][Java] 11654 - 아스키 코드
2023. 7. 27. 20:38
백준/Java
https://www.acmicpc.net/problem/11654 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); char userInput = scanner.next().charAt(0); int asciiNum = (int)userInput; System.out.println(asciiNum); } } char userInput = scanner.next().charAt(0); int asciiNum = (int)userInput; 사용자가 입력한 알파벳을 userInput에 대입합니다. charAt()은 String ..
[백준][Java] 2738 - 행렬 덧셈
2023. 7. 27. 13:54
백준/Java
https://www.acmicpc.net/problem/2738 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int M = scanner.nextInt(); int[][] numArr = new int[N][M]; for (int row = 0; row < N; row++) { for (int column = 0; column < M; column++) { numArr[row][column] = scanner.nextInt(); // 기존 값 추가 } } for (int ..
[백준][Java] 5597 - 과제 안 내신 분..?
2023. 7. 21. 16:17
백준/Java
https://www.acmicpc.net/problem/5597 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); boolean[] checkStudent = new boolean[31]; for (int submit = 0; submit < 28; submit++) { checkStudent[scanner.nextInt()] = true; } for (int notSubmit = 1; notSubmit HTML 삽입 미리보기할 수 없는 소스 참고 1. https://hellodoor.tistory.com/234
[백준][Java] 15552 - 빠른 A+B
2023. 7. 21. 16:14
백준/Java
https://www.acmicpc.net/problem/15552 import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int testCase = Integer.parseInt(bf.readLine()); for (int plusLoop = 0; plusLoop < testCase; plusLoop++) { String..
[백준][Java] 10807 - 개수 세기
2023. 7. 20. 01:53
백준/Java
https://www.acmicpc.net/problem/10807 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] numArr = new int[N]; for (int addNum = 0; addNum < N; addNum++) { numArr[addNum] = scanner.nextInt(); } int v = scanner.nextInt(); int cnt = 0; for (int compare = 0; compare < N; compare++) { if (v ..