user-img
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด 231
SW Expert Academy 1974. ์Šค๋„์ฟ  ๊ฒ€์ฆ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ import java.util.HashSet; import java.util.Scanner; class Solution { public static void main(String args[]) { Scanner sc= new Scanner(System.in); int T; T=sc.nextInt(); Test: for (int test_case = 1; test_case 2์ฐจ์› ๋ฐฐ์—ด์„ ๊ฐ ์š”๊ฑด์— ๋งž๊ฒŒ Hash set์— ๋„ฃ๊ณ  set์˜ size๊ฐ€ 9๊ฐ€ ์•„๋‹ˆ๋ฉด, 0 ์ถœ๋ ฅํ•˜๋ฉด ๋  ๋“ฏ. // 2. ๊ฐ€๋กœ์—์„œ ๊ฒน์น˜๋Š” ๊ฐ’์ด ์žˆ๋Š”์ง€ ..
2023.05.14
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
Sw Expert Academy 1976. ์‹œ๊ฐ ๋ง์…ˆ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด ์ฝ”๋“œ ๋‚œ ํด๋ž˜์Šค๋กœ ํ’€์—ˆ๋Š”๋ฐ, ์ด๊ฑด ๊ทธ๋ƒฅ for๋กœ ํ‘ธ๋Š” ๊ฒŒ ๋” ์ง๊ด€์ ์ด๊ณ  ๋น ๋ฅธ ๋“ฏ ํ•˜๋‹ค... ์ƒ์œ„ ๊ฐœ๋…์œผ๋กœ ํ’€์–ด์•ผ ์ž˜ ํ‘ผ ๊ฑฐ๋ผ๋Š” ์ƒ๊ฐ์„ ๋ฒ„๋ฆฌ์ž. import java.util.Scanner; class Solution { public static void main(String args[]) { Scanner sc= new Scanner(System.in); int T; T=sc.nextInt(); for (int test_case = 1; test_case 12){ refinedH = hour.H-12; }else{ refi..
2023.05.13
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW D2 1979. ์–ด๋””์— ๋‹จ์–ด๊ฐ€ ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ์„๊นŒ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ์ฝ”๋“œ import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; import java.util.Comparator; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int i = 1; i x == K).count()); container.clear(); } } } ํ’€๊ณ  ๋‹ค๋ฅธ ์‚ฌ๋žŒ..
2023.05.13
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SWEA 1983. ์กฐ๊ต์˜ ์„ฑ์  ๋งค๊ธฐ๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด๊ฐ€ ํ‘ผ ์ฝ”๋“œ import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int i = 1; i key = ํ•™์ƒ์˜ ๋ฒˆํ˜ธ, value -> ์ด์  // ArrayList -> index: ์‹œํ—˜ ์ˆœ์œ„, value -> ์ด์  HashMap hashMap = new HashMap(); ArrayList grade = new Arra..
2023.05.11
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SWEA 1984. ์ค‘๊ฐ„ ํ‰๊ท ๊ฐ’ ๊ตฌํ•˜๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ์ฝ”๋“œ import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int i = 1; i long) ์ด๋Š” ์†Œ์ˆ˜์  N๋ฒˆ์งธ ์ž๋ฆฌ์—์„œ ๋ฐ˜์˜ฌ๋ฆผ๋„ ํ‘œํ˜„์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋งŒ์•ฝ ์†Œ์ˆ˜ ๋‘๋ฒˆ์งธ ์ž๋ฆฌ์—์„œ ๋ฐ˜์˜ฌ๋ฆผ ํ•œ ๊ฐ’์„ ์›ํ•œ๋‹ค๋ฉด, Math.round(A*10)/10.0์„ ํ•˜๋ฉด ๋œ๋‹ค. A๋ผ๋Š” double ํ˜• ๋ณ€์ˆ˜๋ฅผ *10 ํ•ด์„œ ๋ฐ˜์˜ฌ๋ฆผ๋˜๋Š” ๋ถ€๋ถ„์„ ์›..
2023.05.11
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
thumbnail
SWEA 1986. ์ง€๊ทธ์žฌ๊ทธ ์ˆซ์ž
SW Expert Academyimport java.util.*;public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int i = 1; i
2023.05.11
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW 1989. ์ดˆ์‹ฌ์ž์˜ ํšŒ๋ฌธ ์ฐพ๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ์ฝ”๋“œ import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int T = sc.nextInt(); ArrayList list = new ArrayList(); sc.nextLine(); for (int i = 1; i
2023.05.10
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW 2005 ํŒŒ๋ฆฌ ํ‡ด์น˜
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ์ฝ”๋“œ import java.util.*; import java.util.function.Predicate; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); // ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๋ฐ›๊ธฐ for (int i = 1; i
2023.05.10
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW 2005 ํŒŒ์Šค์นผ์˜ ์‚ผ๊ฐํ˜•
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.*; import java.util.function.Predicate; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for(int l = 1; l
2023.05.09
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
thumbnail
SW Expert Academy 2007. ํŒจํ„ด ๋งˆ๋””์˜ ๊ธธ์ด
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋‚ด๊ฐ€ ํ‘ผ ์ฝ”๋“œ (1) ์ž…๋ ฅ ๊ฐ’ ๋ฐ›๊ธฐ (2) ์ž…๋ ฅ ๊ฐ’์˜ ๋งˆ๋”” ํŒจํ„ด์„ ์ฒดํฌํ•˜๊ธฐ ์œ„ํ•ด 10๊ฐœ์˜ ๋ฌธ์ž๊ฐ€ ํ•˜๋‚˜์˜ ๋งˆ๋”” ์ผ ๊ฒฝ์šฐ๋ถ€ํ„ฐ 1๊ฐœ์˜ ๋ฌธ์ž๊ฐ€ ํ•˜๋‚˜์˜ ๋งˆ๋””์ผ ๊ฒฝ์šฐ๋ฅผ loop๋ฅผ ๋Œ๋ฉฐ check ํ•œ๋‹ค. (2-1) ๋ฐฐ์—ด์„ ๋งŒ๋“ค๊ณ  ํ•ด๋‹น ๋ฐฐ์—ด์— ์ž˜๋ฆฐ ๋งˆ๋””๋“ค์„ ์ €์žฅํ•œ๋‹ค. (2-2) ๋ฐฐ์—ด์˜ ์›์†Œ๋ผ๋ฆฌ ๋ฌธ์ž์—ด์ด ์ผ์น˜ํ•˜๋Š”์ง€ ํ™•์ธ (2-3) ๋ฌธ์ž์—ด์ด ๋” ์ž‘์•˜์„ ๋•Œ ์ผ์น˜ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”์ง€ check (์žฌ๊ท€ ํ•จ์ˆ˜ ์ด์šฉ) (3) ๋” ์ž‘์•˜์„ ๋•Œ ์ผ์น˜ํ•˜๋ฉด ํ•ด๋‹น ๋งˆ๋”” ์ˆ˜ ๋ฐ˜ํ™˜, ๊ทธ๋Ÿฐ ๊ฒฝ์šฐ ์—†์œผ๋ฉด ํ˜„์žฌ ๋งˆ๋”” ์ˆ˜ ๋ฐ˜ํ™˜ import java.util.*; import ..
2023.05.09
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW D2 1926. ๊ฐ„๋‹จํ•œ 369๊ฒŒ์ž„
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ์ฝ”๋“œ import java.util.*; import java.util.function.Predicate; public class Solution { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int N = sc.nextInt(); String [] strArr = new String[N]; ArrayList charList = new ArrayList(); // 1 ~ N๊นŒ์ง€ ๋ฐฐ์—ด ์•ˆ์— ๋„ฃ๊ธฐ for (int i = 0; i < N ..
2023.05.08
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW D2 1859. ๋ฐฑ๋งŒ์žฅ์ž ํ”„๋กœ์ ํŠธ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ๋ฌธ์ œ ํ•ด์„ ์ฃผ์‹์„ ์‹ผ ๋‚ ์— ์‚ฌ์„œ ๋น„์‹ผ ๋‚ ์— ํŒ๋‹ค. ๋จผ์ € ํ…Œ์ŠคํŠธ ํšŸ์ˆ˜์™€ ํ•œ ํ…Œ์ŠคํŠธ ๋‹น ๋ฉฐ์น  ๋™์•ˆ ์ฃผ์‹์„ ํ•  ๊ฒƒ์ธ์ง€๊ฐ€ ๋‚˜์˜จ๋‹ค. ๋ฌธ์ œ์˜ ์ฃผ์ธ๊ณต์€ ํ•ด๋‹น ๋ฉฐ์น  ๊ฐ„ ์ฃผ๊ฐ€๊ฐ€ ์–ด๋–ป๊ฒŒ ๋ณ€๋™๋  ๊ฒƒ์ธ์ง€ ๋ฏธ๋ฆฌ ์•Œ๊ณ  ์žˆ๋‹ค๋Š” ์„ค์ •์ด๋‹ค. ๋งค์ผ 1์ฃผ๋ฐ–์— ๋ชป ์‚ฐ๋‹ค. ์ฃผ์‹์„ ํ•˜๋Š” ์ผ ์ˆ˜ ๋™์•ˆ ์ตœ๋Œ€์˜ ์ด์ต์„ ๋‚ด๋ฉด ๋œ๋‹ค. ์ผ๋‹จ ๋ฐฐ์—ด ๋ฆฌ์ŠคํŠธ๋ฅผ ๋งŒ๋“ ๋‹ค. ์ด์ต์ด ์ƒ๊ธธ ๋•Œ๋งˆ๋‹ค ์ด์ต๋“ค์„ ๋„ฃ๋Š” ํ†ต์žฅ(profit)์„ ๋งŒ๋“ ๋‹ค. ๋‚ด๊ฐ€ ์‚ฌ๋“ค์ธ ์ฃผ์‹์„ ์ €์žฅํ•  stock ๋ณ€์ˆ˜๋„ ๋งŒ๋“ ๋‹ค. ๋ฐฐ์—ด ๋ฆฌ์ŠคํŠธ์˜ ์ธ๋ฑ์Šค๊ฐ€ ๋‚ ์งœ์ด๊ณ , ๊ฐ’์ด ํ•ด๋‹น ๋‚ ์งœ์˜ ์ฃผ๊ฐ€์ด๋‹ค. ๋ฐฐ์—ด์„ ์ˆœํšŒํ•œ๋‹ค. i์ผ์ฐจ ๋ณด๋‹ค i+..
2023.05.07
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 1545. ๊ฑฐ๊พธ๋กœ ์ถœ๋ ฅํ•ด ๋ณด์•„์š”.
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.ArrayList; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); reverse(a); } static int reverse(int a ) { if(a == 0){ System.out.println(a); return 0; } System.out.print(a + " "); retur..
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 2019. ๋”๋ธ”๋”๋ธ”
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.ArrayList; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int result = 1; for (int i = 0; i
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Academy 1936. 1๋Œ€1 ๊ฐ€์œ„๋ฐ”์œ„๋ณด
SW Expert Academy import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); // 1๊ณผ 3 ์ด๋ฉด 1์ด ์ด๊ธฐ๊ณ  1๊ณผ 2๋ฉด 2๊ฐ€ ์ด๊ธฐ๊ณ  2์™€ 3์ด๋ฉด 3์ด ์ด๊ธด๋‹ค. // 1-2 1-3 2-1 2-3 3-1 3-2 // -1 -2 1 -1 2 1 (๋บ์„ ๋•Œ) // B A A B B A (์ด๊ธฐ๋Š” ์‚ฌ๋žŒ) switch (A-B) { case -1: case 2: System.out.println("B"); break; case -2: case 1: Syste..
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 1933. ๊ฐ„๋‹จํ•œ N ์˜ ์•ฝ์ˆ˜
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com 1. ํ‹€๋ ธ๋˜ ๊ฒƒ import java.util.HashSet; import java.util.Iterator; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet set = new HashSet(); int N = sc.nextInt(); for (int i = 1; i
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
1938 ์•„์ฃผ ๊ฐ„๋‹จํ•œ ๊ณ„์‚ฐ๊ธฐ
SW Expert Academy import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a+b); System.out.println(a-b); System.out.println(a*b); System.out.println(a/b); } }
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 2025 N์ค„ ๋ง์…ˆ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int result = 0; for (int i = 1; i
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 2027 ๋Œ€๊ฐ์„  ์ถœ๋ ฅํ•˜๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.ArrayList; import java.util.Scanner; public class Solution { public static void main(String[] args) { ArrayList list = new ArrayList(); for (int i = 0; i < 5; i++) { // + ๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ํ•˜๋‚˜์˜ ์—ด์„ ์ƒ์„ฑ list.add("+"); } for (int i = 0; i < 5; i++) { // ํ•˜๋‚˜์˜ ์—ด ์ถœ๋ ฅ์„ 5๋ฒˆ ๋ฐ˜๋ณต list.set(i,"#"); // ์ž๊ธฐ ์ฐจ๋ก€์ผ ๋•Œ..
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 2029 ๋ชซ๊ณผ ๋‚˜๋จธ์ง€ ์ถœ๋ ฅํ•˜๊ธฐ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int i = 0; i < T; i++) { int a = sc.nextInt(); int b = sc.nextInt(); System.out.printf("#%d %d %d\n", i+1, a/b, a%b); } } }
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด
SW Expert Academy 2043 ์„œ๋ž์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ
SW Expert Academy SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int P = sc.nextInt(); // ํŒจ์Šค์›Œ๋“œ int K = sc.nextInt(); // ์šฐ๋ฆฌ๊ฐ€ ์‹œ์ž‘ํ•  ๋ฒˆํ˜ธ if (P>=K) { System.out.println(P-K+1); }else { // ์šฐ๋ฆฌ๊ฐ€ ์‹œ์ž‘ํ•  ๋ฒˆํ˜ธ๊ฐ€ ํŒจ์Šค์›Œ๋“œ ๋ณด๋‹ค ํฐ ๊ฒฝ์šฐ, 999๊นŒ์ง€ ์ฐ๊ณ  ๋‹ค์‹œ ์„ธ์•ผํ•จ System.out.println((999-K +1) + P+1); } ..
2023.05.05
์•Œ๊ณ ๋ฆฌ์ฆ˜/๋ฌธ์ œ ํ’€์ด