-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_pre.cpp
More file actions
44 lines (40 loc) · 791 Bytes
/
data_pre.cpp
File metadata and controls
44 lines (40 loc) · 791 Bytes
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
// preprocess the data
/* Write your docstring here*/
/**
* @file Red-Balck_trees.cpp
* @author Jiayong Qin (2057729401@qq.com)
* @brief
* @version 0.1
* @date 2024-12-18
*
* @copyright Copyright (c) 2024
*
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
using namespace std;
struct Point {
/**
* @brief Data used to represent a point in 2D space
*
*/
double x, y;
};
/* The code below is often used for testing */
int main() {
// Your code here
std::ifstream file("data1.txt");
std::ofstream out("data2.txt");
std::string line;
int i = 0;
int x;
while(std::getline(file, line)){
i++;
file >> x ;
out << x << " " << i << std::endl;
}
return 0;
}