#include<stdio.h> typedef struct num { int num ; struct num* next; }link; link* create(int n,int arr[]) { link* now,*node; link* head =(link*)malloc(sizeof(link)); now =head; for(int i=0;i<n;i++) { node =(link*)malloc(sizeof(link)); node->num = arr[i]; now->next =node; now =node; } now=head; return head->next; } void sumx(link* head,int sum) { while(head!=NULL) { sum+=head->num; head= head->next; } printf("%d",sum); } int main() { int sum=0,n; scanf("%d",&n); int arr[n]; for(int i=0;i<n;i++) { scanf("%d",&arr[i]); } link* a= create(n,arr); sumx(a,sum); return 0; }