https://school.programmers.co.kr/learn/courses/30/lessons/12969 import java.util.Scanner; class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); for(int i = 0; i < b; i++){ for(int j = 0; j < a; j++){ System.out.print("*"); } System.out.print("\n"); } } }
프로그래머스
https://school.programmers.co.kr/learn/courses/30/lessons/12950 class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int[][] answer = new int[arr1.length][arr1[0].length]; for(int i = 0; i < arr1.length; i++){ for(int j = 0; j < arr1[0].length; j++){ answer[i][j] = arr1[i][j] + arr2[i][j]; } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/70128 class Solution { public int solution(int[] a, int[] b) { int answer = 0; for(int i = 0; i < a.length; i++){ answer += a[i] * b[i]; } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/86491 class Solution { public int solution(int[][] sizes) { int x = 0; // 가로 int y = 0; // 세로 for(int i = 0; i x) { // 선택한 큰 수 중 가장 큰 수를 max로 x = max; } if(min > y) { // 선택한 작은 수..
https://school.programmers.co.kr/learn/courses/30/lessons/12982 import java.util.Arrays; class Solution { public int solution(int[] d, int budget) { int answer = 0; Arrays.sort(d); // 오름차순 정렬 for(int i = 0; i = 0){ answer += 1; } else{ // 예산 금액보다 크면 멈춤 break; } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/12932 import java.util.Arrays; class Solution { public int[] solution(long n) { String s = Long.toString(n); StringBuffer sb = new StringBuffer(s); String a = sb.reverse().toString(); String[] arr = a.split(""); int[] answer = new int[arr.length]; for (int i = 0; i < arr.length; i++) { answer[i] = Integer.parseInt(arr[i]); } return answer..