분류 전체보기
-
[java]백준 오븐 시계 2525번알고리즘 문제풀이/백준(자바) 2023. 3. 29. 23:41
코드 import java.util.Scanner; public class BOJ_2525 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int h = in.nextInt(); int m = in.nextInt(); int q = in.nextInt(); int s=h*60+m+q; h=s/60; m=s%60; if(h>=24){ h=h-24; } System.out.println(h+" "+m); in.close(); } } 링크 https://www.acmicpc.net/problem/2525 2525번: 오븐 시계 첫째 줄에 종료되는 시각의 시와 분을 공백을 사이에 두고 출력한다. (단, 시는 0부터 2..
-
[java]백준 학점계산 2754번알고리즘 문제풀이/백준(자바) 2023. 3. 28. 23:44
코드 import java.util.Scanner; public class BOJ_2754 { public static void main(String[] args) { Scanner in = new Scanner(System.in); String q = in.next(); double s=0; switch (q) { case "A+": s=4.3; break; case "A0": s=4.0; break; case "A-": s=3.7; break; case "B+": s=3.3; break; case "B0": s=3.0; break; case "B-": s=2.7; break; case "C+": s=2.3; break; case "C0": s=2.0; break; case "C-": s=1.7; br..
-
[java]백준 아스키 코드 11654번알고리즘 문제풀이/백준(자바) 2023. 3. 27. 23:31
코드 import java.util.Scanner; public class BOJ_11654 { public static void main(String[] args) { Scanner in =new Scanner(System.in); int q =in.next().charAt(0); System.out.print(q); in.close(); } } 링크 https://www.acmicpc.net/problem/11654 11654번: 아스키 코드 알파벳 소문자, 대문자, 숫자 0-9중 하나가 주어졌을 때, 주어진 글자의 아스키 코드값을 출력하는 프로그램을 작성하시오. www.acmicpc.net
-
[java]백준 문자와 문자열 27866번알고리즘 문제풀이/백준(자바) 2023. 3. 26. 23:32
코드 import java.util.Scanner; public class BOJ_27866 { public static void main(String[] args) { Scanner in = new Scanner(System.in); String a = in.nextLine(); System.out.println(a.charAt(in.nextInt()-1)); in.close(); } } 링크 https://www.acmicpc.net/problem/27866 27866번: 문자와 문자열 첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$) www.acmi..
-
[java]백준 곱셈 2588번알고리즘 문제풀이/백준(자바) 2023. 3. 25. 20:22
코드 import java.util.Scanner; public class BOJ_2588 { public static void main(String[] args) { Scanner in =new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); System.out.println(a*(b%10)); System.out.println(a*((b%100)/10)); System.out.println(a*(b/100)); System.out.println(a*b); in.close(); } } 링크 https://www.acmicpc.net/problem/2588 2588번: 곱셈 첫째 줄부터 넷째 줄까지 차례대로 (3), (4), (5), (6..
-
[java]백준 기찍 N 2742번알고리즘 문제풀이/백준(자바) 2023. 3. 24. 23:33
코드 import java.util.Scanner; public class BOJ_2742 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i=n; i>0;i-- ){ System.out.println(i); } in.close(); } } 링크 https://www.acmicpc.net/problem/2742 2742번: 기찍 N 자연수 N이 주어졌을 때, N부터 1까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오. www.acmicpc.net