#include <stdio.h>
#include <stdlib.h>
typedef struct create
{
int value
;
struct create
*next
;
} asd
;
int main() {
int a
,n
;
asd
* head
= NULL;
asd
* last
= NULL;
scanf("%d",&n
);
for(int i
= 0;i
<n
;i
++){
scanf("%d",&a
);
asd
* p
= (asd
*)malloc(sizeof(asd
));
p
->value
= a
;
p
->next
= NULL;
if(!head
){
head
= p
;
}
else{
last
->next
= p
;
}
last
= p
;
}
for(head
;head
;head
=head
->next
){
printf("%d\n",head
->value
);
}
}
转载请注明原文地址: https://lol.8miu.com/read-32753.html