C#
백준 10950 : A+B - 3
RIsN
2020. 12. 11. 23:50
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
첫째 줄에 테스트 케이스의 개수 T가 주어진다.
각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10)
각 테스트 케이스마다 A+B를 출력한다.
:: 성공
: 개선점 : 좀 더 직관적으로?
using System;
namespace for01
{
class Program
{
static void Main(string[] args)
{
// :: Input Size and Parse
int size = Int32.Parse(Console.ReadLine());
// :: Calculate with Size
for(int i = 0; i < size; i++)
{
// :: Input number and Parse
string[] input = Console.ReadLine().Split(' ');
int a = Int32.Parse(input[0]);
int b = Int32.Parse(input[1]);
// :: Calculate and Print
Console.WriteLine("{0}", a + b);
}
}
}
}