????????д???????????????????

???????????????????????????????λ??char?????int??????????????????????????浽?????????С?

??????????????????ж????λ??????λ????????λ????????????е???????????????λ????????λ??????????м?1???????÷?????????С????????????????????????洢????????????????????λ??????????????????????????????????????????????????????????

????????????????????

#include <stdio.h>
#include <assert.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#define NUM_LEN 500
#define ctoi(c) (c-48)
//#define max(a??b)    (((a) > (b)) ? (a) : (b))
//itoa
struct _big_num;
typedef _big_num big_num;
typedef  big_num* pbig_num;
struct _big_num
{
????//?????????????й??ж???λ??????
????int index;
????//???????????λ
????int maxsize;
????char *buff;
????//?????????λ
????char *nums;
};

//??????
/*int ctoi(int c)
{
????return (c-48);
}*/

//???????????壬????????棬????
pbig_num big_num_create(char *num)
{
pbig_num p = NULL;
p = (pbig_num)malloc(sizeof(*p));
assert(p);
p->buff = (char*)malloc(NUM_LEN);
p->nums = (char*)malloc(NUM_LEN);
//memset(p)
memset(p->buff??0??NUM_LEN);
memset(p->nums??0??NUM_LEN);
p->maxsize = NUM_LEN;
p->index = 0;
????if (num != NULL)
????{
????strncpy(p->buff??num??NUM_LEN);
????p->index = strlen(num);
????}
return p;
}

//??????
void big_num_free(pbig_num *b)
{
????assert(b);
????free((*b)->buff);
????free((*b)->nums);
????free((*b));
}
//???????????????????
int aligh_num(char *s1??int size)
{
????int n = strlen(s1);
????//??????????
????char *tmp = (char*)malloc(n);
????memset(tmp??0??n);
????//????????????
????strncpy(tmp??s1??n);
????memset(s1????0????size);
????memcpy(s1+size??tmp??n);
????free(tmp);
????return 0;
}