목록수학 (30)
happy coding
class Solution { public int solution(int n) { int answer = 0; for (int i=0 ; i
class Solution { public double solution(int[] numbers) { double answer = 0; for(int i=0 ; i
class Solution { public int solution(int n, int k) { int answer = 0; if(n >= 10) { answer = 12000*n + 2000*(k-(n/10)); } else { answer = 12000*n + 2000*k; } return answer; } }
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); boolean[] remainderExists = new boolean[42]; // 0부터 41까지의 나머지에 대한 존재 여부 배열 for (int i = 0; i < 10; i++) { int num = Integer.parseInt(br.readLine()); int numCorr = num % 42; remainderExists[numCorr] = true; } int count = 0; for..
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] arr; int testcaseNum = Integer.parseInt(br.readLine()); StringTokenizer st; for (int i=0 ; i< testcaseNum ; i++) { st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); //..
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = Integer.parseInt(st.nextToken()); System.out.println(gcd(a,b)); System.out.println(lc..
정수 num1과 num2가 매개변수로 주어질 때, num1을 num2로 나눈 값에 1,000을 곱한 후 정수 부분을 return 하도록 soltuion 함수를 완성해주세요. class Solution { public int solution(int num1, int num2) { double answer = (double) num1 / num2 * 1000; return (int)answer; } }