#ifndef infint_hpp
#define infint_hpp
#include<iostream>
#include<string>
#include<string.h>
#define MAX_INT64 (INT64)0x7FFFFFFFFFFFFFFF
#define MIN_INT64 (INT64)0x8000000000000000
#define UN_INIT 0xCCCCCCCCCCCCCCCC
typedef long long INT64;
/*
+
-
++
--
+=
-=
*
*=
=
*
*=
negative
*/
class Infint {
public:
Infint();
Infint(int value);
Infint(const char* pData);
// string reverseStr(string input) const;
Infint operator+(const Infint& infint);
Infint operator-(const Infint& infint);
Infint operator*(const Infint& infint);
Infint operator ++(int);
Infint operator --(int);
Infint operator +=(const Infint& inf);
Infint operator -=(const Infint& inf);
Infint operator *=(const Infint& infint);
protected:
bool IsINT64Overflow() const;
friend std::ostream& operator<<(std::ostream& _cout, const Infint& bigdata);
void INT64ToString();
bool IsLeftStrBig(const char* pLeft, int LSize, const char* pRight, int RSize);
char SubLoop(char* pLeft, int LSize, char* pRight, int RSize);
std::string add(std::string left, std::string right);
std::string minus(std::string left, std::string right);
std::string multiply(std::string left, std::string right);
protected:
int _value;
std::string strData;
};
#endif
'C++ > 학교 숙제' 카테고리의 다른 글
session_4_ex infint.cpp(완성) (0) | 2018.04.22 |
---|---|
session_6_ex 답 (0) | 2018.04.22 |
session_6_ex (0) | 2018.04.22 |
string 문자열 뺄셈계산 (0) | 2018.04.15 |
string 문자열 덧셈계산 (0) | 2018.04.14 |
댓글