1998-08-05から1日間の記事一覧

5人の学生を 身長で ソート (構造体)

C

明解C言語 入門編 > 12. 構造体 > 5人の学生を 身長で ソート (構造体) C #include <stdio.h> #include <string.h>#define NINSU 5typedef struct { char name[20]; int height; float weight; } gstudent;void swap(gstudent* x, gstudent* y) { gstudent tmp = *x; *x = *y;</string.h></stdio.h>…