분류 전체보기

[Spring Boot] intelliJ로 Spring Boot 프로젝트 생성 및 실행하기
Spring Boot란? Spring Boot는 Spring이라는 자바 프레임워크의 프로젝트를 의미하여 Spring으로 개발할 때 보다 간단한 설정으로 쉽게 웹 애플리케이션을 만들 수 있습니다. 즉, Spring Boot는 Spring을 쉽게 사용할 수 있도록 필요한 설정 대부분을 미리 세팅 해놨다고 보시면 됩니다. Spring Boot의 특징 독립 실행이 가능한 Spring 애플리케이션 생성 Tomcat, Jetty, Undertow를 자체적으로 내장 : WAR 파일을 따로 만들 필요 없고 Servlet Container도 따로 설치 않고도 실행 가능 스타터(starter)를 통해 간결한 의존성(Maven/Gradle) 구성 지원 Spring 및 라이브러리에 대한 설정이 자동으로 되어있음 XML 코드를..

[백준] 3. 반복문 - 25304. 영수증 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int rcpt = sc.nextInt(); // 영수증 금액 int total = sc.nextInt(); // 토탈 개수 int sum = 0; for (int i = 1; i

[백준] 3. 반복문 - 8393. 합 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int j = 0; sc.close(); for (int i = 1; i

[백준] 3. 반복문 - 10950. A+B - 3 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int arr[] = new int[num]; // 배열선언 for (int i = 0; i < num; i++) { int a = sc.nextInt(); int b = sc.nextInt(); arr[i] = a + b; } sc.close(); for (int j : arr) { System.out.println(j); } } } 여러 방법으로 푸는 방법이 있겠지만 나는 배열 원소에 입력받은 a 와 b를 더해주어 i 번째 배열에..

[백준] 3. 반복문 - 2739. 구구단 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); // 몇단 sc.close(); for (int i = 1; i < 10; i++) { System.out.println(num + " * " + i + " = " + num * i); } } } 반복문에서 제일 기초적인 문제이다! 다만 주의할 점이라면 출력에서 보듯이 문자 사이에 공백이 있으니 반드시 유의해야한다. 출처 https://www.acmicpc.net/problem/2739 2739번: 구구단 N을 입력받은 뒤, 구구단 ..

[백준] 2. 조건문 - 2480. 주사위 세개 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); sc.close(); // 1. 만약 모든 변수가 다르면 int max = 0; if (a != b && b != c && a != c) { // 만약 a > b 라면 if (a > b) { // c > a > b 일때 if (c > a) { max = c; } else { max = a; } } else { // c > b > a 일때 if (c > b) {..

[백준] 2. 조건문 - 2525. 오븐 시계 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); // 시간 int min = sc.nextInt(); // 분 int timer = sc.nextInt(); // 요리시간 sc.close(); int Min = 60*hour+min; //시 ->분 Min += timer; int Hour = (Min / 60) % 24; int minute = Min % 60; System.out.println(Hour + " " + minute); } } 알람 시계 문제에서는 주어진 시간에서 ..

[백준] 2. 조건문 - 2884. 알람 시계 (Java11)
문제 풀이 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); // 시간 int min = sc.nextInt(); // 분 sc.close(); if (min 45..