#include <stdio.h>
#include <math.h>

typedef struct{
	int id;
	double height;
	double weight;
}Body;

int main(void) {
	
	Body data[5] = {
		{1,165,60},
		{2,170,68},
		{3,160,50},
		{4,180,75},
		{5,175,80}
	};
	
	Body temp;
	double avg = 0,std = 0;
	int i,j;
	//並び替え
	for(i = 0;i < 4; i ++){
		for(j = 0;j < 4 - i;j ++){
			if(data[j].height > data[j + 1].height){
				temp = data[j];
				data[j] = data[j + 1];
				data[j + 1] = temp;
			}
		}
	}
	//並び替え表示
	for(i = 0;i < 5;i ++){
		printf("%d,%lf,%lf\n",data[i].id,data[i].height,data[i].weight);
	}
	//平均
	for(i = 2;i < 5;i ++){
		avg += data[i].height;
	}
	avg = avg / 3;
	//標準偏差
	for(i = 2;i < 5;i ++){
		std += (data[i].height - avg) * (data[i].height);
	}
	std = sqrt(std / 3);
	
	printf("平均：%lf\n",avg);
	printf("標準偏差：%lf\n",std);
	
	return 0;
}