#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<fstream>
using namespace std;
int main(void){
std::cout << "ファイル名を入力してください" << std::endl;
std::string fileName;
cin >> fileName;
ofstream outputFile(fileName);
while (true) {
std::cout << "番号を入力してください" << std::endl;
int number;
cin >> number;
if(number == 0){
break;
}
if(number < 0 || 100 < number){
std::cout << "1〜99の間で入力してください" << std::endl;
continue;
}
std::cout << "名前を入力してください" << std::endl;
auto name = std::string();
cin >> name;
std::cout << "年齢を入力してください" << std::endl;
auto age = int();
cin >> age;
std::cout << "身長を入力してください" << std::endl;
auto height = double();
cin >> height;
auto rowText = std::string(
to_string(number) + " " +
name + " " +
to_string(age) + " ");
outputFile << rowText << fixed << setprecision(2) << height << endl;
cout << rowText << fixed << setprecision(2) << height << std::endl;
}
}