일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Two Points
- 그래프
- 이진탐색
- 스토어드 프로시저
- binary search
- 다익스트라
- Trie
- SQL
- Stored Procedure
- String
- union find
- two pointer
- DP
- Dijkstra
- Brute Force
- Hash
- MYSQL
Archives
- Today
- Total
codingfarm
map 활용 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include<iostream> #include<map> #include<string> using namespace std; int main(void) { map<string, int> mp; mp["hello"] = 100; cout << mp["hello"] << endl; // 이미 있는 값이므로 100을 출력한다. cout << mp["world"] << endl; // world를 키로 값는 element가 없으므로 // key가 "world", vale가 0인 원소를 추가 한 후, 0을 출력한다. cout << ++mp["C++"] << endl; return 0; } | cs |
'Programming Language > C++' 카테고리의 다른 글
정적 라이브러리 (0) | 2021.05.06 |
---|---|
프로젝트 셋팅 - 미리 컴파일된 헤더(Precompiled Header) (0) | 2021.05.05 |
vector 정렬하기 (0) | 2021.04.21 |
std::initializer_list (0) | 2021.04.17 |
std::vector의 push_back과 emplace_back의 차이 (0) | 2021.04.16 |
Comments