using System;
namespace codingstudy
{
class Program
{
static void Main()
{
int t = int.Parse(Console.ReadLine()); // 테스트 케이스 입력
int sum = 0;
for (int i = 0; i < t; i++)
{
string[] s = Console.ReadLine().Split(); // 더할 값 입력
int num1 = int.Parse(s[0]);
int num2 = int.Parse(s[1]);
sum = num1 + num2;
Console.WriteLine($"Case #{i+1}: {sum}");
}
}
}
}
처음에는 아래에 for문을 돌리고 그랬었는데
하다보니까 엥 이것보다 더 쉬운게 있는데.. 하다가
Console.WriteLine을 저렇게 쓰면 된다는 것을 생각해냈다..
안 맞으면 어떡하지 했는데 맞아서 좋았다 힛
'C# > C# (백준)' 카테고리의 다른 글
[C#] 백준 알고리즘 2439번, 별 찍기 -2 (0) | 2023.01.12 |
---|---|
[C#] 백준 알고리즘 11022번, A+B - 8 (0) | 2023.01.11 |
[C#] 백준 알고리즘 15552번, 빠른 A+B (0) | 2023.01.09 |
[C#] 백준 알고리즘 25304번, 영수증 (0) | 2022.12.29 |
[C#] 백준 알고리즘 1526번, 평균 (0) | 2022.08.22 |