-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06_Vector_25.cpp
More file actions
32 lines (32 loc) · 1015 Bytes
/
Copy path06_Vector_25.cpp
File metadata and controls
32 lines (32 loc) · 1015 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
#include <bits/stdc++.h>
using namespace std;
int main(){
vector<pair<string,string>> stu;
string input1,input2;
while(true){
cin >> input1;
if(input1=="q") break;
cin >> input2;
stu.push_back(make_pair(input1,input2));
}
cin.ignore();
string edit;
getline(cin,edit);
istringstream iss(edit);
string word;
while(iss >> word){
for(auto &m : stu){
if(word==m.first){
if(m.second=="B+") m=make_pair(m.first,"A" );
if(m.second=="B" ) m=make_pair(m.first,"B+");
if(m.second=="C+") m=make_pair(m.first,"B" );
if(m.second=="C" ) m=make_pair(m.first,"C+");
if(m.second=="D+") m=make_pair(m.first,"C" );
if(m.second=="D" ) m=make_pair(m.first,"D+");
if(m.second=="F" ) m=make_pair(m.first,"D" );
}
}
}
for(auto itr : stu) cout << itr.first << " " << itr.second << endl;
return 0;
}