728x90
반응형
https://www.acmicpc.net/problem/10757
10757번: 큰 수 A+B
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
www.acmicpc.net

풀이
BigInteger (큰 정수) 사용하기
https://docs.microsoft.com/ko-kr/dotnet/api/system.numerics.biginteger?view=net-5.0
BigInteger 구조체 (System.Numerics)
부호 있는 임의의 큰 정수를 나타냅니다.Represents an arbitrarily large signed integer.
docs.microsoft.com
1
2
3
4
5
6
7
8
9
10
|
using System;
using System.Numerics;
class Program{
static void Main(){
string[] s = Console.ReadLine().Split();
BigInteger a = BigInteger.Parse(s[0]);
BigInteger b = BigInteger.Parse(s[1]);
Console.Write(a+b);
}
}
|
cs |
728x90
반응형
'C# > 백준 알고리즘' 카테고리의 다른 글
2022.01.25 [백준] C# 부녀회장이 될테야 (0) | 2022.01.25 |
---|---|
2022.01.25 [백준] C# ACM호텔 (0) | 2022.01.25 |
2022.01.25 [백준] C# 분수 찾기 (0) | 2022.01.25 |
2022.01.25 [백준] C# 벌집 (0) | 2022.01.25 |
2022.01.25 [백준] C# 그룹 단어 체커 (0) | 2022.01.25 |
댓글