//geshi.cpp
//将综合的数据文件转化为输入的文件格式
#include<iostream.h>
#include<iomanip.h>
#include "fstream.h"
#include "stdlib.h"
void main()
{
int year1,year2,month,day,hour,stab;
double wd,ws,temp,nomh,chmh;
ifstream infile;
ofstream outfile;
infile.open("geshiqian.txt",ios::in);
outfile.open("geshihou.txt",ios::in);
if(!infile)
{
cout<<"cannot open file"<<endl;
exit(1);
}
while(1)
{
infile>>year1>>year2>>month>>day>>hour;
infile>>wd>>ws>>temp>>stab>>nomh>>chmh;
setiosflags(ios::right);
outfile<<setw(1)<<year1<<setw(1)<<year2<<setw(2)<<month<<setw(2)<<day<<setw(2)<<hour;
setiosflags(ios::fixed);
outfile<<setw(9)<<setprecision(1)<<wd;
outfile<<setw(9)<<setprecision(1)<<ws;
outfile<<setw(6)<<setprecision(1)<<temp;
outfile<<setw(2)<<stab;
outfile<<setw(7)<<setprecision(3)<<nomh;
outfile<<setw(7)<<setprecision(3)<<chmh<<'\n';
if(infile.eof())break;
}
infile.close;
outfile.close;
}