로딩
요청 처리 중입니다...

[cpp] numeric data type이 큰경우 boost/multiprecision

 [cpp] numeric data type이 큰경우 boost/multiprecision

#include #include #include #include using namespace std; using namespace boost::multiprecision; string solution(string a, string b) { string answer = ""; cpp_int _a(a); cpp_int _b(b); cpp_int _answer = _a + _b; answer = _answer.str(); return answer; } 만약 일반 데이터 타입으로 했다면 터진다 a = "18446744073709551615" b = 287346502836570928366" // 이렇게 하면 core dump 된다 #include #include #include using namespace std; strin...