본문 바로가기
반응형

전체 글131

[SW Expert Academy] Intermediate / Array1 / 1206. [S/W 문제해결 기본] Flatten Array1) 1204. Flatten_ package array1; import java.util.Scanner; import java.io.FileInputStream; class Flatten { public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); // txt 파일 읽어오는 소스코드 // System.setIn(new FileInputStream("res/1206_input.txt")); // 행, 열, 테스트케이스길이, 정답 int dump; int Box[] = new int[100]; // 10개의 테스트 케이스 반복 for (int test_case = 1; test_case.. 2021. 8. 12.
[SW Expert Academy] Intermediate / Array1 / 1206. [S/W 문제해결 기본] View Array1) 1204. View_ package array1; import java.util.Scanner; import java.io.FileInputStream; class Solution { public static void main(String args[]) throws Exception { // txt 파일 읽어오는 소스코드 // System.setIn(new FileInputStream("res/1206_input.txt")); Scanner sc = new Scanner(System.in); // 행, 열, 테스트케이스길이, 정답 int r, c, T; int ans = 0, secondView = 0; // 10개의 테스트 케이스 반복 for (int test_case = 1; test_.. 2021. 8. 12.
[SW Expert Academy] Intermediate / Array1 / 1204. [S/W 문제해결 기본] 최빈수 구하기 Array1) 1204. 최빈수구하기_ package array1; import java.util.Scanner; import java.io.FileInputStream; class Solution { public static void main(String args[]) throws Exception { // txt 파일 읽어오는 소스코드 // System.setIn(new FileInputStream("res/input.txt")); Scanner sc = new Scanner(System.in); int T; T = sc.nextInt(); /* * 여러 개의 테스트 케이스가 주어지므로, 각각을 처리합니다. */ int N; int[] stud = new int[1000]; // 학생 수 1000명 .. 2021. 8. 12.
[Java] 백준 단계별 풀기 2 (1330번, 9498번, 2753번, 14681번, 2884번) 1330번_ import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub int A,B; Scanner scan = new Scanner(System.in); A = scan.nextInt(); B = scan.nextInt(); if(A>B) { System.out.println(">"); } else if (A=90) { System.out.println("A"); } else if (A>=80) { System.out.println("B"); } else if(A>=70) { System.out.println("C"); } else if(A>=.. 2021. 8. 12.
[Java] 백준 단계별 풀기 1 (10712번, 1000번, 1001번, 10998번, 10869번, 10430번, 2588번) *Java는 코드 제출할 때 class 명을 Main으로 설정하고 제출해야 컴파일 에러가 안난다. 10712번_ public class Main { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("|\\_/|"); System.out.println("|q p| /}"); System.out.println("( 0 )\"\"\"\\"); System.out.println("|\"^\"` |"); System.out.println("||_/=\\\\__|"); } } 1000번_ import java.util.Scanner; public class Main { public static .. 2021. 8. 12.