#include /* 構造体 vector の宣言 */ struct vector { int x; int y; }; /* ベクトル表示のための関数 */ void printVector( struct vector* v ){ printf("( %d, %d )\n", v->x, v->y ); } /* ベクトルの和 a+b */ void addVector( struct vector* a, struct vector* b ){ /* このコメント文を消して,必要なプログラムコードを書き込みなさい. */ } /* ベクトルの差 a-b */ void subVector( struct vector* a, struct vector* b ){ /* このコメント文を消して,必要なプログラムコードを書き込みなさい. */ } /* ベクトルの内積 a*b */ void innerProduct( struct vector* a, struct vector* b ){ /* このコメント文を消して,必要なプログラムコードを書き込みなさい. */ } int main(void){ struct vector a, b; scanf("%d %d", &a.x, &a.y); scanf("%d %d", &b.x, &b.y); printf("a = "); printVector(&a); printf("b = "); printVector(&b); printf("a+b = "); addVector(&a, &b); printf("a-b = "); subVector(&a, &b); printf("a*b = "); innerProduct(&a, &b); return 0; }