求两个长整数的相加
请大家看看这个程序能求两个长整数相加么#include "stdio.h"
#include "malloc.h"
#define NULL 0
#define LEN sizeof(struct add)
struct add
{
long num1;
long num2;
long result;
result=num1+num2;
struct *next;
};
int n;
struct add *creat(void)
{
struct add *head;
struct add *p1,*p2;
n=0;
p1=p2(struct add *)malloc(LEN);
scanf("%ld,%ld",&p1->num1,&p1->num2);
head=NULL;
while(p1->num1!=0&&p2->num2!=0)
{
n=n+1;
if(n==1)
head=p1;
else p2->next=p;
p2=p1;
p1=(struct student *)malloc(LEN);
scanf("%ld,%ld",&p1->num1,&p1->num2);}
}
p2->next=null;
return(head);
}
void print(struct add *head)
{
struct add *p;
p=head;
if(head!=NULL)
do
{
printf("%ld",p->result);
p=p->next;
}while(p!=NULL);
}
int main(int argc, char* argv[])
{
printf("请输入相加的两个数:");
creat();
print(struct add *head);
return 0;
}