请问为什么这个高精度类在运算时死循环/RE了?
class int_t
{
private:
int len,a[45];
public:
int_t(int q=0)
{
if(q)while(a[++len]=q%10,q/=10);
}
int&operator[](int x)
{
return a[x];
}
friend std::ostream&operator<<(std::ostream&a,int_t n)
{
for(int i=n.len;i;--i)putchar(n[i]^48);
return a;
}
friend int_t&operator+=(int_t&a,int_t b)
{
if(b.len>a.len)a.len=b.len;
int i;
for(i=1;i<=a.len;++i)a[i]+=b[i];
for(i=1;i<=a.len;++i)a[i+1]+=a[i]/10,a[i]%=10;
if(a[a.len+1])++a.len;
return a;
}
int_t count()
{
int i;
for(i=1;i<=len;++i)a[i]<<=1;
for(i=1;i<=len;++i)a[i+1]+=a[i]/10,a[i]%=10;
if(a[len+1])++len;
return *this;
}
}ans;