#include "../../std_lib_facilities.h"
struct Reading{
int hour;
double temperation;
Reading(int h, double t):hour(h),temperation(t) {};
};
void main()
{
cout<<"please enter input file name:"<<endl;
string name;
cin>>name;
ifstream ifst(name.c_str());
if(!ifst) error("can't open input file ",name);
cout<<"Please enter output file name:";
cin>>name;
ofstream ofst(name.c_str());
if(!ofst) error("can't open input file ",name);
vector<Reading> temps;
int hour;
double temperature;
while(ifst>>hour>>temperature )
{
if(hour <0 || hour > 23) error("hour out of range");
temps.push_back(Reading(hour, temperature));
}
for(int i = 0; i<temps.size(); ++i)
{
ofst<<'('<<temps[i].hour<<','<<temps[i].temperation<<")\n";
}
keep_window_open();
}