#include #include /* 構造体 vnode の宣言 */ struct vnode { int x; int y; struct vnode* next; }; /* 周辺の長さを計算 */ double roundLength( struct vnode* head ){ /* このコメント文を消して,必要なプログラムコードを書き込みなさい. */ } int main(void){ struct vnode sample[3]; struct vnode* head; /* 各データを格納 */ sample[0].x = 2; sample[0].y = 3; sample[1].x = 1; sample[1].y = -1; sample[2].x = 7; sample[2].y = 2; /* 各ノードを連結 */ head = &sample[0]; sample[0].next = &sample[1]; sample[1].next = &sample[2]; sample[2].next = head; /* 周辺の長さを表示 */ printf("三角形の周辺の長さ = %lf\n", roundLength(head) ); return 0; }