-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocess.cpp
54 lines (51 loc) · 1.11 KB
/
preprocess.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fp1;
ofstream fp2;
fp1.open("./dataset/test3.txt");
fp2.open("./dataset/test2.txt");
int times = 0;
while(true)
{
char f;
fp1 >> f;
if(f == 't')
{
if(times == 0)
{
int x,y;
fp1 >> x >> y;
fp2 << "t # 0" << endl;
fp2 << "25 38 30" << endl;
times ++;
}
else
{
fp2 << "t # -1" << endl;
break;
}
}
else if(f == 'v')
{
int u,l;
for(int i = 0; i < 25; i++)
{
fp1 >> u >> l;
fp2 << "v " << u-1 << " " << l << endl;
}
}
else if(f == 'e')
{
int u, v;
for(int i = 0; i < 37; i++)
{
fp1 >> u >> v;
fp2 << "e " << u-1 << " " << v-1 << " 1" << endl;
}
}
}
fp1.close(); fp2.close();
}