백준1712

🔑알고리즘/baekjoon

백준 1712 : 손익분기점 - 자바 문제 풀이

백준 1712번 문제입니다. A는 매년 무조건 드는 비용 B는 물건을 만드는데 드는 비용 C는 물건의 개수 n은 손익분기점 손익분기점을 구하기 위해서는 B가 C보다 작아야한다. 그리고 손익분기점은 A+n*B > C*n이다. import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextInt(); long b = sc.nextInt(); long c = sc.nextInt(); long n = 1; while (a + n * b >= c * n && b c) n = -1; System.out..

pkyung
'백준1712' 태그의 글 목록