-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInputGraph.cpp
62 lines (52 loc) · 1.27 KB
/
InputGraph.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
55
56
57
58
59
60
61
62
/**
* @file test.cpp
* @brief Used as a preprocessor to convert the input file into a format that can be read by file:plotGraph.py
* @author Nishith Kumar (2020A7PS0157H)
* @author Anshul Kanodia (2020A7PS0174H)
* @author Suvigya Sharma (2020A7PS0140H)
* @author Vartika Gupta (2019A7PS0729H)
* @version 3.0.1
*
*
* @bug No known bugs
*/
#include <bits/stdc++.h>
using namespace std ;
int main() {
ifstream fin;
fin.open("./testcases/input4.txt");
//vector<Vertex*> v;
int n;
fin >> n;
ofstream fout;
fout.open("plotData.txt");
string xstring="";
string ystring="";
double start, end;
for(int i = 0; i<(n-1); i++) {
double x,y;
fin >> x >> y;
if(i==0) {
start = x;
end = y;
}
// cout << x << " " << y << endl;
xstring+= to_string(x);
xstring+=" ";
ystring+= to_string(y);
ystring+=" ";
}
double x,y;
fin >> x >> y;
// cout << x << " " << y << endl;
xstring+= to_string(x);
xstring+=" ";
ystring+= to_string(y);
ystring+=" ";
xstring+= to_string(start);
ystring+= to_string(end);
fout<<xstring<<endl;
fout<<ystring<<endl;
fout.close();
return 0;
}