목록Algorithm (127)
main
* 2부터 차례대로 나눠주면 따로 소수를 구할 필요가 없다. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int i = 2; while (i
* Math.max * Math.min import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.nextLine(); String operator = sc.nextLine(); String B = sc.nextLine(); String answer = "1"; int A_size = A.length(); int B_size = B.length(); if (operator.equals("*")) { for (int i = 0; i < (A_size - 1) + (B_size - 1); i++) { answer += "0..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = Integer.parseInt(sc.nextLine()); for (int i = 0; i < num; i++) { int repeat = sc.nextInt(); String str = sc.next(); for (char c : str.toCharArray()) { for (int j = 0; j < repeat; j++) { System.out.print(c); } } System.out.println(); } } }
* double 소수점 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = Integer.parseInt(sc.nextLine()); for (int i = 0; i < num; i++) { String str = sc.nextLine(); String[] strs = str.split(" "); double answer = -1; for (int j = 0; j < strs.length; j++) { if (j == 0) { answer = Double.parseDouble(strs[0]); } else { switc..