1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#include <iostream>
using namespace std;
 
class Bigint {
public :
    typedef unsigned long long ull;
private :
    ull * content[1000];
    int index;
public :
    Bigint() { }
 
    Bigint(ull _content) : index(0)
    { 
        content[0= new ull(_content);
    }
 
    void expand(ull target)
    {
        index++;
        content[index] = new ull(target);
    }
 
    Bigint& operator= (const Bigint& target)
    {
        for (int i = 0; i <= index; i++)
        {
            delete content[i];
        }
        index = target.index;
        for (int i = 0; i <= index; i++)
        {
            content[i] = new ull(*target.content[i]);
        }
        return *this;
    }
 
    Bigint operator* (const int target)
    {    
        Bigint save(*this);
        ull s =0;
        for (int i = 0; i <= index; i++)
        {
            *content[i] = *content[i] * target;
            *content[i] = *content[i] + s;
            s = (*content[i]) >> 16;
            *content[i] = *content[i] & 0x0000FFFF;
        }
        if (s)
        {
            save.expand(s);
        }
        return save;
    }
 
    Bigint operator+ (const Bigint& target)
    {
        Bigint save(*this);
        ull s = 0;
        for (int i = 0; i <= index; i++)
        {
            *content[i] = *content[i] + s;
            if (i <= target.index)
            {
                *content[i] = *content[i] + *target.content[i];
            }
            s = (*content[i]) >> 16;
            *content[i] = *content[i] & 0x0000FFFF;
        }
        if (index < target.index)
        {
            for (int i = index + 1; i <= target.index; i++)
            {
                save.expand(s + *target.content[i]);
                s = (*content[i]) >> 16;
                *content[i] = *content[i] & 0x0000FFFF;
            }
        }
        if (s)
        {
            save.expand(s);
        }
        return save;
    }
 
    bool operator< (const Bigint& target)
    {
        if (index < target.index)
        {
            return 1;
        }
        else if (index == target.index)
        {
            if (*content[index] < *target.content[target.index])
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
        else
        {
            return 0;
        }
    }
 
    void show()
    {
        for (int i = index; i >= 0; i--)
        {
            cout << *content[i];
        }
        cout << endl;
    }
 
    ~Bigint() 
    { 
        for (int i = 0; i <= index; i++)
        {
            delete content[i];
        }
    }
};
 
int main()
{
    Bigint *solid[4];//0:a, 1:b, 2:전에먹은량, 3:지금 먹은량
    int a, b, c;
 
    cin >> a >>b;
    solid[0= new Bigint(a);
    solid[1= new Bigint(b);
    solid[2= new Bigint(0);
    cin >> a >> b >> c;
    
    *solid[0= *solid[0* a;
    *solid[1= *solid[1* b;
 
    solid[0]->show();
 
    delete solid[0];
    delete solid[1];
    delete solid[2];
 
    return 0;
}
cs

그냥 뭐 여러 이론있던데 제가 생각하기 편한대로 구현해보고 있습니다.
다짯다 생각하고 체크해봤는데 대입 연산자 오버로딩쪽에서 뭔가 문제가 발생하는군여 ㅈㅈ;