-Code
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int start = sc.nextInt();
int before = sc.nextInt();
int after = sc.nextInt();
int money = start;
int month = 1;
while (money < 70) {
money += before;
month++;
}
while (money < 100) {
money += after;
month++;
}
System.out.println(month);
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] [PCCE 기출문제] 2번 / 피타고라스의 정리 (0) | 2025.02.22 |
---|---|
[프로그래머스/Java] [PCCE 기출문제] 4번 / 병과분류 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 5번 / 산책 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 1번 / 문자 출력 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 2번 / 각도 합치기 (0) | 2025.02.21 |