-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.cpp
More file actions
45 lines (37 loc) · 1.06 KB
/
index.cpp
File metadata and controls
45 lines (37 loc) · 1.06 KB
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
#include <bits/stdc++.h>
#include <cstring>
#include <string>
using namespace std;
int main() {
cin.tie(0), ios::sync_with_stdio(0);
string str = "DATA/";
string str2 = ".txt";
for(int i=1995;i<=2019;i++){
string team_name = str+to_string(i)+str2;
vector<string> team;
map<string,string> rec;
fstream FILE_NAME;
FILE_NAME.open(team_name,ios::in);
string tmp;
while(getline(FILE_NAME,tmp)){
string team_tmp_name;
for(int i=1;i<tmp.length();i++){
if(tmp[i]=='"')break;
team_tmp_name += tmp[i];
}
team.push_back(team_tmp_name);
rec[team_tmp_name] = tmp;
}
FILE_NAME.close();
fstream FILE_NAME2;
FILE_NAME2.open(team_name,ios::out);
for(auto &t:rec){
for(int j=0;j<t.second.length();j++){
if(t.second[j]!='$')FILE_NAME2<<t.second[j];
}
FILE_NAME2<<"\n";
}
FILE_NAME2.close();
}
return 0;
}