-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapSTL.cpp
51 lines (36 loc) · 984 Bytes
/
MapSTL.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
// problem : https://www.hackerrank.com/challenges/cpp-maps/problem
// soultion =======================================================
/*
#include <iostream>
#include <map>
int main() {
int Q = 0; std::cin >> Q;
std::map<std::string, int> studentMap;
int QueryType;
std::string studentName;
int studentMarks;
while (Q != 0) {
std::cin >> QueryType;
std::cin >> studentName;
if (QueryType == 1) {
std::cin >> studentMarks;
studentMap[studentName] += studentMarks;
Q -= 1;
continue;
}
if (QueryType == 2) {
studentMap[studentName] = 0;
Q -= 1;
continue;
}
if (QueryType == 3) {
std::cout << studentMap[studentName] << std::endl;
Q -= 1;
continue;
}
Q -= 1;
}
return 0;
}
*/
// =====================================================================