/* a11-1-3.c */
#include <stdio.h>

int main(void)
{
	FILE *fp;
	char name[20];
	double height, weight;

	if( (fp = fopen("body.txt", "w") ) == NULL) {
		printf("File open error.\n");
		return 1;
	}

	printf("氏名 身長 体重を入力してください。（終了条件：Ctrl+Z）\n");
	while (scanf("%19s %lf %lf", name, &height, &weight) != EOF) {
		fprintf(fp, "氏名：%-20s　身長：%5.1f　体重：%5.1f\n", 
					name, height, weight);
	}

	fclose(fp);

	return 0;
}
