??????????
????????? ???????[ 2010/6/4 10:50:49 ] ????????
//???м???
//s????????????????
pbig_num big_num_add2(pbig_num pb??char *s)
{
static char tmp[3] = {0};
int n = strlen(s);
//p???????????????0???????
char *p;
char *num2 = (char*)malloc(NUM_LEN);
memset(num2??0??NUM_LEN);
strncpy(num2??s??n);
????if (pb->index > n)
????{
????//num2???????0
????p = num2;
????aligh_num(p??pb->index - n);
????}
????else if (n > pb->index)
????{
????p = pb->buff;
????aligh_num(p??n - pb->index);
????}
int i;
//???0????????????
n = strlen(num2);
pb->index = strlen(pb->buff);
????for (i = n - 1; i >= 0; i--)
????{
????memset(tmp??0??3);
????int x = 0;
????x = ctoi(num2[i]) + (ctoi(pb->buff[i])) + (pb->nums[i]);
????sprintf(tmp??"%d"??x);
????????if (strlen(tmp) == 2 && i != 0)
????????{
????????pb->nums[i-1] = ctoi(tmp[0]);
????????pb->buff[i] = tmp[1];
????????}
????????else
????????{
????????pb->buff[i] = tmp[0];
????????}
????}
free(num2);
return pb;
}
int _tmain(int argc?? _TCHAR* argv[])
{
????pbig_num pbn = big_num_create("1234");
????big_num_add2(pbn??"123431");
????puts(pbn->buff);
????fwrite(pbn->buff??pbn->index??1??stdout);
????getchar();
????big_num_free(&pbn);
????return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11