#include<stdio.h>//看在我画蛇填脚背丫子的用了链表的份上呜呜呜,求求赞赞 #include<stdlib.h> typedef struct num { int a; int b; struct num *next; }link; link * create(int n) { link*head,*node,*now; head =(link*)malloc(sizeof(link)); now=head; for(int i=1;i<=n;i++) { node=(link*)malloc(sizeof(link)); scanf("%d%d",&node->a,&node->b); now->next =node; now=node; } return head; } void sum(int sum1,int sum2,link* head) { link*node =head->next; while(node!=NULL) { sum1+=node->a; sum2+=node->b; node =node->next; } printf("%d %d",sum1,sum2); } int main() { int n; scanf("%d",&n); link *a=create(n); int sum1=0,sum2=0; sum(sum1,sum2,a); return 0; }