
-Code
import java.util.Scanner;
public class BOJ34687 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
System.out.println(m * 100 >= n * 81 ? "yaho" : "no");
}
}
처음에 0.81을 곱해서 했으나 부동 소수점 오차 때문에 위와 같이 해서 해결했습니다.
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
| [LeetCode/Java] 67. Add Binary (0) | 2025.11.22 |
|---|---|
| [백준/Java] 27445번 Gorani Command (0) | 2025.11.22 |
| [LeetCode/Java] 66. Plus One (0) | 2025.11.21 |
| [LeetCode/Java] 58. Length of Last Word (0) | 2025.11.20 |
| [LeetCode/Java] 35. Search Insert Position (0) | 2025.11.20 |