[C#] 백준 25304번 : 영수증
using System;
class Program
{
static void Main()
{
string a = Console.ReadLine();
string b = Console.ReadLine();
int num1 = int.Parse(a);
int num2 = int.Parse(b);
int sum = 0;
for (int i = 0; i < num2; i++)
{
string c = Console.ReadLine();
string[] numbers = c.Split(' ');
int num3 = int.Parse(numbers[0]);
int num4 = int.Parse(numbers[1]);
sum += (num3 * num4);
}
if (sum == num1)
{
Console.WriteLine("Yes");
} else
{
Console.WriteLine("No");
}
}
}
반응형
'백준 > C#' 카테고리의 다른 글
[C#] 백준 15552번 : 빠른 A+B (0) | 2025.01.23 |
---|---|
[C#] 백준 25314번 : 코딩은 체육과목 입니다 (0) | 2025.01.23 |
[C#] 백준 8393번 : 합 (0) | 2025.01.23 |
[C#] 백준 10950번 : A+B - 3 (0) | 2025.01.23 |
[C#] 백준 2739번 : 구구단 (0) | 2025.01.23 |