java63 코딩테스트 입문 - Day 7 특정 문자 제거하기class Solution { public String solution(String my_string, String letter) { return my_string.replace(letter,""); }}각도기class Solution { public int solution(int angle) { if(angle 양꼬치class Solution { public int solution(int n, int k) { return n*12000 + k*2000 - n/10*2000; }}짝수의 합class Solution { public int solution(int n) { n = n - n%2; .. 2025. 4. 12. 코딩테스트 입문 - Day 6 뒤집힌 문자열class Solution { public String solution(String my_string) { StringBuilder sb = new StringBuilder(); for(int i = my_string.length() - 1; i >= 0; i--){ sb.append(my_string.charAt(i)); } return sb.toString(); }}직각삼각형 출력하기import java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner sc = new Sca.. 2025. 4. 12. 코딩테스트 입문 - Day 5 옷가게 할인 받기class Solution { public static int solution(int price) { int answer = 0; if(price >= 100000 && price = 300000 && price = 500000){ answer = (int) (price - (price * 0.2)); System.out.println(answer); }else { answer = price; } return answer; }}아이스 아메리카노class Solution { public int[] solution(int money) { .. 2025. 4. 12. 프로그래머스 - 코딩테스트 입문 Day 4 피자 나눠먹기 (1)class Solution { public int solution(int n) { int answer = 0; if(n%7 == 0){ answer = n/7; } else{ answer = n/7 + 1; } return answer; }}피자 나눠먹기 (2)class Solution { public static int solution(int n) { int p = n; //6과 n의 최소 공배수 while(n % 6 != 0){ n += p; } return n/6; .. 2025. 4. 12. 이것이 자바다 - 챕터5 연습 문제 8번 int[][] array = { { 95, 86 }, { 83, 92, 96 }, { 78, 83, 93, 87, 88 } }; int sum = 0; int cnt = 0; for(int i = 0; i9번 Scanner sc = new Scanner(System.in); int students = 0; int[] scores = null; while (true) { System.out.println("-----------------------------------------------"); System.out.println("1.학생수 | 2.점수입력 | 3.점수리스트 | 4.분석 | 5.종료"); System.out.println("---------------.. 2025. 4. 5. 이것이 자바다 - 챕터4 연습 문제 3번 // 3번 int sum = 0; for(int i =1;i4번 // 4번 while(true) { int one = (int)(Math.random() * 6 + 1); int two = (int)(Math.random() * 6 + 1); System.out.println("1 번째 : " + one); System.out.println("2 번째 : " + two); if(one + two == 5) { System.out.println("주사위 합 : " + (one + two)); break; } } 5번// 5번 for(int i = 0; i6번// 6번 for(int i=0;i7번// 7번 int money = 0; .. 2025. 4. 5. 이전 1 ··· 5 6 7 8 9 10 11 다음 728x90 반응형