summaryrefslogtreecommitdiffstats
path: root/test.cpp
blob: fecf9cd089ec8bf9e94b6eae547101c65e7a85a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
using namespace std;

int main()
{
    fstream fr,fw;
    fr.open("data/delta_T.txt",ios::in);
    fw.open("fuck1.txt",ios::out);
    int year;
    string s;
    char sout[1024];
    double a[4];
    fw<<"double d={"<<endl;
    while(getline(fr,s))
    {
        sscanf(s.c_str(),"%d%lf%lf%lf%lf",&year,&a[0],&a[1],&a[2],&a[3]);
        sprintf(sout,"{%d,\t%lf,\t%lf,\t%lf,\t%lf},",year,a[0],a[1],a[2],a[3]);
        fw<<sout<<endl;
    }
    fw<<"};"<<endl;
    fr.close();
    fw.close();
    return 0;
}