题解 | #牛牛的平面向量#
牛牛的平面向量
https://www.nowcoder.com/practice/0e0d472d6a30469ab90d8b0aef7f81fe
#include <stdio.h> #include <string.h> typedef struct xiangliang { int x; int y; }xiangliang; int main() { int n; scanf("%d",&n); xiangliang p[n]; int k; for(k=0;k<n;k++) scanf("%d %d",&p[k].x,&p[k].y); int i; int x=0,y=0; for(i=0;i<n;i++) { x+=p[i].x; y+=p[i].y; } printf("%d %d",x,y); return 0; }