#include<stdio.h>
#include<stdlib.h>
struct List{
int data;
struct List *next;
};
void set_list(struct List *p,int n){
int i=1;
struct List *p1 = NULL;
p1 = (struct List *)malloc(sizeof(struct List));
p->next = p1;
p1->next = NULL;
scanf("%d",&(p1->data));
while(n-1){
set_list(p1, n-1);
break;
}
}
int main(){
int n;
scanf("%d",&n);
struct List *head1 = NULL;
struct List *head2 = NULL;
head1 = (struct List*)malloc(sizeof(struct List));
head2 = (struct List*)malloc(sizeof(struct List));
set_list(head1, n);
set_list(head2, n);
struct List *p1 = head1->next;
struct List *p2 = head2->next;
for(int i=0;i<n;i++){
p2->data +=p1->data;
printf("%d ",p2->data);
p1=p1->next;
p2=p2->next;
}
return 0;
}
#include<stdlib.h>
struct List{
int data;
struct List *next;
};
void set_list(struct List *p,int n){
int i=1;
struct List *p1 = NULL;
p1 = (struct List *)malloc(sizeof(struct List));
p->next = p1;
p1->next = NULL;
scanf("%d",&(p1->data));
while(n-1){
set_list(p1, n-1);
break;
}
}
int main(){
int n;
scanf("%d",&n);
struct List *head1 = NULL;
struct List *head2 = NULL;
head1 = (struct List*)malloc(sizeof(struct List));
head2 = (struct List*)malloc(sizeof(struct List));
set_list(head1, n);
set_list(head2, n);
struct List *p1 = head1->next;
struct List *p2 = head2->next;
for(int i=0;i<n;i++){
p2->data +=p1->data;
printf("%d ",p2->data);
p1=p1->next;
p2=p2->next;
}
return 0;
}