#include<iostream.h>
#include<stdio.h>
#include<math.h>
struct Dnode{
int data;
Dnode *prv;
Dnode *next;
};
class Bigint
{
public:
Dnode *head,
*p,
*q,
*r;
public:
void input();
void shaw();
void clear();
void insert(int n);
void output(Bigint &b);
Bigint(){
head=new Dnode;
head->prv=NULL;
head->next=NULL;
head->data=NULL;
}
Bigint(Bigint &a);
~Bigint(){
r=this->head;
while(r!=head){
p=r;
delete p;
r=r->next;
}
}
friend Bigint operator +(Bigint& a,Bigint& b);
friend Bigint operator *(Bigint& a,Bigint& b);
Bigint operator = (const Bigint &BigNum);
};
Bigint::Bigint(Bigint &a){ //拷贝构造
this->head=new Dnode;
p=head;
q=a.head;
r=a.head->next;
this->head->next=NULL;
this->head->prv=NULL;
while(r!=a.head){
Dnode *b=new Dnode;
b->next=head;
b->data=r->data;
p->next=b;
b->prv=p;
head->prv=b