본문 바로가기

자바137

[백준/Java] 10952번 A+B - 5 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true){ int a = sc.nextInt(); int b = sc.nextInt(); if (a == 0 && b == 0){ break; } System.out.println(a + b); } } } 2022. 4. 17.
[백준/Java] 10951번 A+B - 4 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()){ int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a + b); } } } 2022. 4. 17.
[백준/Java] 10950번 A+B - 3 -Code import java.util.Scanner; public class Main { 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.println(a + b); } } } 2022. 4. 17.
[백준/Java] 2675번 문자열 반복 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++){ int r = sc.nextInt(); String s = sc.next(); for (int j = 0; j < s.length(); j++){ for (int k = 0; k < r; k++){ System.out.print(s.charAt(j)); } } System.out.println(); } } } 2022. 4. 17.
[백준/Java] 5543번 상근날드 -Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int bugerMin = 3000; int drinkMin = 3000; for (int i = 0; i buger){ bugerMin = buger; } } for (int i = 0; i drink){ drinkMin = drink; } } System.out.println(buger.. 2022. 4. 17.
[백준/Java] 10818번 최소, 최대 -Code import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] nums = new int[n]; for (int i = 0; i < nums.length; i++){ nums[i] = sc.nextInt(); } Arrays.sort(nums); System.out.println(nums[0] + " " + nums[n - 1]); } } 2022. 4. 16.