
-Code
import java.util.Scanner;
public class BOJ25304 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int n = sc.nextInt();
int total = 0;
for (int i = 0; i < n; i++) {
int price = sc.nextInt();
int cnt = sc.nextInt();
total += price * cnt;
}
System.out.println(total == x ? "Yes" : "No");
}
}'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
| [백준/Java] 15552번 빠른 A+B (0) | 2025.12.20 |
|---|---|
| [백준/Java] 10250번 ACM 호텔 (0) | 2025.12.20 |
| [백준/Java] 27025번 Morning Exercises (0) | 2025.12.20 |
| [LeetCode/Java] Reverse Words in a String (0) | 2025.12.19 |
| [LeetCode/Java] Reverse Vowels of a String (0) | 2025.12.19 |